avoid-abbreviations-in-doc-comments
Same as avoid_abbreviations_in_doc_comments in Pyramid Lint
- Group
- Style
- Path
lint/style/avoid-abbreviations-in-doc-comments- Default
- Off, opt in
- Origin
- Pyramid Lint
- Rule
- 12 of 512
Flags Latin abbreviations in doc comments.
Doc comments are read by API consumers who may not share the author's first
language, and abbreviations like e.g., i.e., etc., and et al. are
easy to misread or mistranslate. Spelling them out ("for example", "that
is", "and so on") keeps generated documentation unambiguous. Only ///
doc-comment lines are scanned, and the first occurrence of each abbreviation
on a line is reported.
Invalid
/// Validates tokens, e.g. JWT and opaque tokens.
class AuthService {
/// Rate limiting, i.e. throttling requests.
bool validateToken(String token) => token.isNotEmpty;
/// Handles sessions, cookies, etc.
late Map<String, dynamic> config;
/// See Smith et al. for the derivation.
void checkParams(String param) {
print(param);
}
/// Two on one line e.g. this and i.e. that.
void init() {}
}/// Validates tokens, e.g. JWT and opaque tokens.class AuthService { /// Rate limiting, i.e. throttling requests. /// Handles sessions, cookies, etc. /// See Smith et al. for the derivation. /// Two on one line e.g. this and i.e. that. /// Two on one line e.g. this and i.e. that.Valid
/// The implementation of the authentication service.
class AuthService {
/// Helper function to validate tokens.
bool validateToken(String token) => token.isNotEmpty;
/// Stores configuration data in the repository.
late Map<String, dynamic> config;
/// Check parameter values, for example email validation.
void checkParams(String param) {
print(param);
}
/// Initialize utility variables and, that is, defaults.
void init() {}
// A regular (non-doc) comment is out of scope, e.g. this is fine.
void process(String arg) {}
/// Case-sensitive: E.g. and I.e. at sentence start are not flagged.
void setup() {}
}Configure avoid-abbreviations-in-doc-comments
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"avoid-abbreviations-in-doc-comments": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/avoid-abbreviations-in-doc-comments: <reason>More style rules
- avoid-annotating-with-dynamic
avoid_annotating_with_dynamicFlags parameters explicitly annotated with
dynamic. - avoid-bloc-public-fieldsbloc
Keep package-confirmed Bloc instance fields private; inherited API overrides are allowed.
- avoid-bloc-public-methodsbloc
Enforce the package-confirmed Bloc convention.
- avoid-bool-literals-in-conditional-expressions
avoid_bool_literals_in_conditional_expressionsrecommendedFlags conditional expressions over
boolthat have aboolliteral branch. - avoid-catches-without-on-clauses
avoid_catches_without_on_clausesAvoid
catchclauses without anontype. - avoid-catching-errors
avoid_catching_errorsDon't explicitly catch
Erroror types that implement it. - avoid-double-and-int-checks
avoid_double_and_int_checksrecommendedAvoid checking a value for
doubleand then forint. - avoid-equals-and-hash-code-on-mutable-classes
avoid_equals_and_hash_code_on_mutable_classesFlags
==andhashCodeoverrides in classes not marked@immutable.