Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the 'library_names' lint #183

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
- added `library_annotations` (https://github.com/dart-lang/lints/issues/177)
- added `no_wildcard_variable_uses` (https://github.com/dart-lang/lints/issues/139)
- removed `package_prefixed_library_names` (https://github.com/dart-lang/lints/issues/172)
- `recommended`:
- removed `library_names` (https://github.com/dart-lang/lints/issues/181)
- Updated the SDK lower-bound to 3.1.
- Add a section on upgrading to the latest lint set to the readme.

Expand Down
1 change: 0 additions & 1 deletion lib/recommended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ linter:
- empty_statements
- exhaustive_cases
- implementation_imports
- library_names
- library_prefixes
- library_private_types_in_public_api
- no_leading_underscores_for_library_prefixes
Expand Down
1 change: 0 additions & 1 deletion rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
| [`empty_statements`](https://dart.dev/lints/empty_statements) | Avoid empty statements. | ✅ |
| [`exhaustive_cases`](https://dart.dev/lints/exhaustive_cases) | Define case clauses for all constants in enum-like classes. | ✅ |
| [`implementation_imports`](https://dart.dev/lints/implementation_imports) | Don't import implementation files from another package. | |
| [`library_names`](https://dart.dev/lints/library_names) | Name libraries using `lowercase_with_underscores`. | |
| [`library_prefixes`](https://dart.dev/lints/library_prefixes) | Use `lowercase_with_underscores` when specifying a library prefix. | |
| [`library_private_types_in_public_api`](https://dart.dev/lints/library_private_types_in_public_api) | Avoid using private types in public APIs. | |
| [`no_leading_underscores_for_library_prefixes`](https://dart.dev/lints/no_leading_underscores_for_library_prefixes) | Avoid leading underscores for library prefixes. | ✅ |
Expand Down
10 changes: 2 additions & 8 deletions tool/gen_docs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,8 @@ String _createRuleTable(
final ruleMeta =
lintMeta.firstWhereOrNull((meta) => meta['name'] == rule);

if (ruleMeta == null) {
print('rules.json data for rule \'$rule\' not found.');
print('Update lib/rules.json from '
'https://raw.githubusercontent.com/dart-lang/site-www/main/src/_data/linter_rules.json.');
exit(1);
}
final description = ruleMeta['description'] as String?;
final hasFix = ruleMeta['fixStatus'] == 'hasFix';
final description = ruleMeta?['description'] as String? ?? '';
final hasFix = ruleMeta?['fixStatus'] == 'hasFix';
final fixDesc = hasFix ? '✅' : '';

return '| [`$rule`](https://dart.dev/lints/$rule) | $description | $fixDesc |';
Expand Down
27 changes: 21 additions & 6 deletions tool/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
"name": "avoid_returning_null_for_future",
"description": "Avoid returning null for Future.",
"fixStatus": "hasFix"
"fixStatus": "noFix"
},
{
"name": "avoid_slow_async_io",
Expand Down Expand Up @@ -72,7 +72,7 @@
{
"name": "comment_references",
"description": "Only reference in scope identifiers in doc comments.",
"fixStatus": "noFix"
"fixStatus": "hasFix"
},
{
"name": "control_flow_in_finally",
Expand All @@ -82,7 +82,7 @@
{
"name": "deprecated_member_use_from_same_package",
"description": "Avoid using deprecated elements from within the package in which they are declared.",
"fixStatus": "needsFix"
"fixStatus": "hasFix"
},
{
"name": "diagnostic_describe_all_properties",
Expand Down Expand Up @@ -134,6 +134,11 @@
"description": "Boolean expression composed only with literals.",
"fixStatus": "noFix"
},
{
"name": "missing_code_block_language_in_doc_comment",
"description": "A code block is missing a specified language.",
"fixStatus": "needsEvaluation"
},
{
"name": "no_adjacent_strings_in_list",
"description": "Don't use adjacent strings in list.",
Expand Down Expand Up @@ -179,6 +184,11 @@
"description": "Avoid `throw` in finally block.",
"fixStatus": "noFix"
},
{
"name": "unintended_html_in_doc_comment",
"description": "Use of angle brackets in a doc comment is treated as HTML by Markdown.",
"fixStatus": "needsEvaluation"
},
{
"name": "unnecessary_statements",
"description": "Avoid using unnecessary statements.",
Expand Down Expand Up @@ -247,7 +257,7 @@
{
"name": "always_require_non_null_named_parameters",
"description": "Specify `@required` on named parameters without defaults.",
"fixStatus": "hasFix"
"fixStatus": "noFix"
},
{
"name": "always_specify_types",
Expand Down Expand Up @@ -522,7 +532,7 @@
{
"name": "flutter_style_todos",
"description": "Use Flutter TODO format: // TODO(username): message, https://URL-to-issue.",
"fixStatus": "noFix"
"fixStatus": "hasFix"
},
{
"name": "implementation_imports",
Expand Down Expand Up @@ -871,7 +881,7 @@
},
{
"name": "require_trailing_commas",
"description": "Use trailing commas for all function calls and declarations.",
"description": "Use trailing commas for all parameter lists and argument lists.",
"fixStatus": "hasFix"
},
{
Expand Down Expand Up @@ -984,6 +994,11 @@
"description": "Avoid library directives unless they have documentation comments or annotations.",
"fixStatus": "hasFix"
},
{
"name": "unnecessary_library_name",
"description": "Don't have a library name in a `library` declaration.",
"fixStatus": "hasFix"
},
{
"name": "unnecessary_new",
"description": "Unnecessary new keyword.",
Expand Down