Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit e60e9f9

Browse files
authored
fix: fix excludes for rules intended only for tests (#1022)
1 parent 2eec475 commit e60e9f9

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
* feat: add logger and progress indication.
6+
* fix: fix excludes for rules intended only for tests.
67
* chore: changed min `SDK` version to `2.18.0`.
78
* chore: restrict `analyzer` version to `>=5.1.0 <5.2.0`.
89
* chore: restrict `analyzer_plugin` version to `>=0.11.0 <0.12.0`.

lib/src/analyzers/lint_analyzer/rules/rules_list/avoid_top_level_members_in_tests/avoid_top_level_members_in_tests_rule.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AvoidTopLevelMembersInTestsRule extends CommonRule {
2323
id: ruleId,
2424
severity: readSeverity(config, Severity.warning),
2525
excludes:
26-
hasExcludes(config) ? readExcludes(config) : ['/**', '!test/**'],
26+
hasExcludes(config) ? readExcludes(config) : ['lib/**', 'bin/**'],
2727
);
2828

2929
@override

lib/src/analyzers/lint_analyzer/rules/rules_list/prefer_correct_test_file_name/prefer_correct_test_file_name_rule.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PreferCorrectTestFileNameRule extends CommonRule {
2727
id: ruleId,
2828
severity: readSeverity(config, Severity.warning),
2929
excludes:
30-
hasExcludes(config) ? readExcludes(config) : ['/**', '!test/**'],
30+
hasExcludes(config) ? readExcludes(config) : ['lib/**', 'bin/**'],
3131
);
3232

3333
@override

website/docs/rules/common/avoid-top-level-members-in-tests.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It helps reduce code bloat and find unused declarations in test files.
88

99
::: note
1010

11-
If you want to set `exclude` config for this rule, the default `['/**', '!test/**']` will be overriden.
11+
If you want to set `exclude` config for this rule, the default `['lib/**', 'bin/**']` will be overriden.
1212

1313
:::
1414

website/docs/rules/common/prefer-correct-test-file-name.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Warns if the file within `/test` contains a `main`, but the file name doesn't en
66

77
:::note
88

9-
If you want to set `exclude` config for this rule, the default `['/**', '!test/**']` will be overriden.
9+
If you want to set `exclude` config for this rule, the default `['lib/**', 'bin/**']` will be overriden.
1010

1111
:::
1212

0 commit comments

Comments
 (0)