Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9b70b6e
Migrate/avoid global state (#227)
Islam-Shaaban-Ibrahim Apr 15, 2026
87f0bd5
migrated avoid non null assertion rule and tests (#230)
Islam-Shaaban-Ibrahim Apr 16, 2026
1119f5c
Migrate/avoid debug print in release mode (#228)
Islam-Shaaban-Ibrahim Apr 16, 2026
04a0112
Migrate/proper super calls (#229)
Islam-Shaaban-Ibrahim Apr 21, 2026
7a8bcfe
Migrated prefer_early_return and its tests (#233)
Dariaa14 Apr 23, 2026
2006202
Migrate avoid unnecessary return variable rule and its tests (#237)
daria-trusca-solid Jun 4, 2026
5bcbbf0
Migrate avoid unnecessary set state rule and its tests (#238)
daria-trusca-solid Jun 4, 2026
adfd585
migrate prefer early return rule with tests (#232)
Islam-Shaaban-Ibrahim Jun 8, 2026
be820c7
Migrate avoid unrelated type assertions and its tests (#239)
daria-trusca-solid Jun 10, 2026
7e8403a
Migrate newline before return rule and its tests (#240)
daria-trusca-solid Jun 10, 2026
4a31bb2
Migrate no equal then else rule and its tests (#241)
daria-trusca-solid Jun 10, 2026
e5eef63
refactor: migrate double_literal_format to analysis_server_plugin (#281)
andrew-bekhiet-solid Jun 10, 2026
1cd1032
Implementation of parameter parser (#234)
Dariaa14 Jun 10, 2026
17d049a
feat: migrate avoid_final_with_getter (#242)
andrew-bekhiet-solid Jun 15, 2026
c54bc50
refactor: migrate avoid_returning_widgets rule (#243)
andrew-bekhiet-solid Jun 15, 2026
13fdf86
refactor: migrate avoid_unnecessary_type_assertions (#282)
andrew-bekhiet-solid Jun 18, 2026
4e0f6ac
fix: update avoid_unnecessary_return_variable (#236)
solid-illiaaihistov Jun 18, 2026
d123c1d
fix: support await expressions in proper_super_calls (#291)
solid-illiaaihistov Jun 18, 2026
addb4b3
refactor: migrate avoid_unused_parameters (#290)
andrew-bekhiet-solid Jun 19, 2026
a978a20
remove avoid_unnecessary_type_casts (#289)
andrew-bekhiet-solid Jun 19, 2026
8736521
feat: add use_nearest_context rule (#293)
solid-illiaaihistov Jun 22, 2026
1940463
refactor: migrate cyclomatic_complexity (#294)
solid-illiaaihistov Jun 23, 2026
9c5842a
refactor: migrate prefer_first (#286)
andrew-bekhiet-solid Jun 23, 2026
c6cd0b2
refactor: migrate function_lines_of_code rule (#296)
solid-illiaaihistov Jun 24, 2026
56125c8
refactor: rename table_driven_rule_test to table_driven_rule_test_bas…
solid-illiaaihistov Jun 24, 2026
f32d2ae
refactor: migrate no_empty_block (#299)
solid-illiaaihistov Jun 25, 2026
db01743
refactor: migrate prefer last (#287)
andrew-bekhiet-solid Jun 25, 2026
8b1d145
refactor: migrate no_magic_number rule (#300)
solid-illiaaihistov Jun 26, 2026
16e3e13
Migrate avoid_late_keyword rule (default behavior) and tests (#231)
Islam-Shaaban-Ibrahim Jun 26, 2026
823f3ad
refactor: migrate number_of_parameters (#302)
solid-illiaaihistov Jun 30, 2026
d4f3c8d
refactor: migrate member_ordering rule (#297)
solid-illiaaihistov Jul 1, 2026
e2db387
refactor: migrate named_parameters_ordering (#298)
solid-illiaaihistov Jul 1, 2026
0f1e202
refactor: migrate prefer_conditional_expressions (#303)
solid-illiaaihistov Jul 1, 2026
1b70d99
test: add test for type promotion in avoid_unnecessary_return_variabl…
solid-illiaaihistov Jul 6, 2026
824547f
fix: resolve rules configuration being ignored in nested directories …
solid-illiaaihistov Jul 6, 2026
bbd9ea4
refactor: use AutoTestLintOffsets in remaining AnalysisRuleTest suite…
solid-illiaaihistov Jul 6, 2026
0376fd6
feat: add exclude_annotation support to avoid_unused_parameters (#312)
solid-illiaaihistov Jul 6, 2026
562cddd
feat: avoid non null assertion ignored types (#313)
solid-illiaaihistov Jul 6, 2026
e3a06fb
refactor: migrate prefer_match_file_name (#305)
solid-illiaaihistov Jul 7, 2026
b38c6d9
refactor: migrate avoid_using_api (#304)
solid-illiaaihistov Jul 8, 2026
9567254
refactor: consolidate lint fix registration logic (#316)
solid-illiaaihistov Jul 10, 2026
c22a8aa
refactor: update automatic documentation generation (#315)
solid-illiaaihistov Jul 17, 2026
afd181c
fix: support package-level analysis options and rule suppression (#318)
solid-illiaaihistov Jul 17, 2026
8c27812
Add new rule: use_descriptive_names_for_type_parameters (#319)
solid-illiaaihistov Jul 17, 2026
d9f8964
Fix GitHub Actions workflow (#322)
solid-illiaaihistov Jul 22, 2026
24d6168
Add new rule avoid_similar_names (#321)
solid-illiaaihistov Jul 22, 2026
d8ccca1
Add new rule avoid_duplicate_code (#320)
solid-illiaaihistov Jul 22, 2026
34fef8a
Add feature_envy rule (#323)
solid-illiaaihistov Jul 22, 2026
ab09847
feat: add avoid_similar_names and feature_envy rules to changelog (#324)
solid-illiaaihistov Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 3 additions & 6 deletions .github/workflows/flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7

- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand All @@ -24,17 +24,14 @@ jobs:
run: dart format . --set-exit-if-changed

- name: Run default analyzer
run: flutter analyze

- name: Run custom analyzer
run: dart run custom_lint
run: dart analyze

- name: Run tests
run: |
# run tests if `test` folder exists
if [ -d test ]
then
flutter test -r expanded
dart test -r expanded
else
echo "Tests not found."
fi
52 changes: 36 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.0.0

- feat!: migrate to analyzer_server_plugin
- refactor: replace `avoid_unnecessary_type_casts` rule with dart analyzer's
`unnecessary_cast`
- Added `use_nearest_context` rule.
- Added `avoid_duplicate_code` rule.
- Added `use_descriptive_names_for_type_parameters` rule.
- Added `avoid_similar_names` rule.
- Added `feature_envy` rule.

## 0.3.3

- Fix pub.dev analysis issue
Expand All @@ -11,9 +22,9 @@

- Added `allow_with_comments` parameter for `no_empty_block` lint.
- Added extension support for `avoid_using_api`
- Added `exclude_entity` parameter for `prefer_match_file_name` lint.
It is now possible to configure this lint to ignore `enum`,
`extension` and `mixin` declarations via `analysis_options.yaml`.
- Added `exclude_entity` parameter for `prefer_match_file_name` lint. It is now
possible to configure this lint to ignore `enum`, `extension` and `mixin`
declarations via `analysis_options.yaml`.

## 0.3.0

Expand All @@ -24,7 +35,8 @@
- `function_lines_of_code`
- `no_empty_bloc`
- `number_of_parameters`
- BREAKING CHANGE: Renamed `excludeNames` parameter to `exclude` for `function_lines_of_code` lint.
- BREAKING CHANGE: Renamed `excludeNames` parameter to `exclude` for
`function_lines_of_code` lint.
- Fixed an issue with `prefer_early_retrun` for throw expression
- `number_of_parameters` lint: added `copyWith` to the default exclude list.
- Update dependencies:
Expand All @@ -47,28 +59,36 @@
## 0.2.0

- Added `avoid_final_with_getter` rule
- Improve `avoid_late_keyword` - `ignored_types` to support ignoring subtype of the node type (<https://github.com/solid-software/solid_lints/issues/157>)
- Abstract methods should be omitted by `proper_super_calls` (<https://github.com/solid-software/solid_lints/issues/159>)
- Add a rule prefer_guard_clause for reversing nested if statements (<https://github.com/solid-software/solid_lints/issues/91>)
- add exclude params support to avoid_returning_widgets rule (<https://github.com/solid-software/solid_lints/issues/131>)
- add quick fix to avoid_final_with_getter (<https://github.com/solid-software/solid_lints/pull/164>)
- Improve `avoid_late_keyword` - `ignored_types` to support ignoring subtype of
the node type (<https://github.com/solid-software/solid_lints/issues/157>)
- Abstract methods should be omitted by `proper_super_calls`
(<https://github.com/solid-software/solid_lints/issues/159>)
- Add a rule prefer_guard_clause for reversing nested if statements
(<https://github.com/solid-software/solid_lints/issues/91>)
- add exclude params support to avoid_returning_widgets rule
(<https://github.com/solid-software/solid_lints/issues/131>)
- add quick fix to avoid_final_with_getter
(<https://github.com/solid-software/solid_lints/pull/164>)
- Renamed `avoid_debug_print` to `avoid_debug_print_in_release`
- The `avoid_debug_print_in_release` no longer reports a warning if the `debugPrint` call is wrapped in a `!kReleaseMode` check.
- The `avoid_debug_print_in_release` no longer reports a warning if the
`debugPrint` call is wrapped in a `!kReleaseMode` check.
- Update custom_lints to work with newer Flutter

## 0.1.5

- Added `avoid_debug_print` rule
- Fixed an issue with no_magic_number lint
- Fixed `avoid_unused_parameters` to report positional parameters from typedef if their name are not underscores.
- Fixed `avoid_unused_parameters` to report positional parameters from typedef
if their name are not underscores.
- Improvement for `avoid_returning_widget` lint:
- ignores methods that override ones that return widget (build() for example)
- no longer allows returning widgets from methods/functions named build
- Fixed unexpected avoid_unnecessary_type_assertions
- Added `excludeNames` param for `function_lines_of_code` lint
- Improved `avoid_unrelated_type_assertions` to support true and false results
- Set default `cyclomatic_complexity` to 10 (<https://github.com/solid-software/solid_lints/issues/146>)
Credits: Arthur Miranda (<https://github.com/arthurbcd>)
- Set default `cyclomatic_complexity` to 10
(<https://github.com/solid-software/solid_lints/issues/146>) Credits: Arthur
Miranda (<https://github.com/arthurbcd>)

## 0.1.4

Expand Down Expand Up @@ -102,8 +122,7 @@
- avoid_unnecessary_type_casts
- avoid_unrelated_type_assertions
- avoid_unused_parameters
- avoid_using_api
Credits: getBoolean (<https://github.com/getBoolean>)
- avoid_using_api Credits: getBoolean (<https://github.com/getBoolean>)
- cyclomatic_complexity
- double_literal_format
- function_lines_of_code
Expand Down Expand Up @@ -170,7 +189,8 @@

## 0.0.13

- enable use_colored_box & use_decorated_box + add more comments about specific lints
- enable use_colored_box & use_decorated_box + add more comments about specific
lints

## 0.0.12

Expand Down
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,26 @@ dev_dependencies:
solid_lints: <INSERT LATEST VERSION>
```

And then include `solid_lints` into your project top-level `analysis_options.yaml`:
Enable the plugin and include `solid_lints` in your project's top-level `analysis_options.yaml`:

### Option 1: Using the `plugins` block

```yaml
include: package:solid_lints/analysis_options.yaml

plugins:
solid_lints:
```

Also you can use a specialized rule set designed for Dart tests.
### Option 2: Using the top-level `solid_lints` block

```yaml
include: package:solid_lints/analysis_options.yaml

solid_lints:
```

Also, you can use a specialized rule set designed for Dart tests.
Add an `analysis_options.yaml` file under the `test/` directory, and include the ruleset:

```yaml
Expand All @@ -36,7 +49,34 @@ Then you can see suggestions in your IDE or you can run checks manually:

```bash
dart analyze;
dart run custom_lint;
```

# Configuration

You can customize individual rule settings in your `analysis_options.yaml`.

### Option 1: Inside the `plugins` block (Recommended)

```yaml
plugins:
solid_lints:
diagnostics:
cyclomatic_complexity:
max_complexity: 10
avoid_non_null_assertion: true
```

### Option 2: Separate top-level `solid_lints` block

```yaml
plugins:
solid_lints:

solid_lints:
diagnostics:
cyclomatic_complexity:
max_complexity: 10
avoid_non_null_assertion: true
```

# Badge
Expand Down
6 changes: 6 additions & 0 deletions doc/docusaurus/docs/1_rulesets/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Given the quite large threshold configured for this metric we considered extract

Both options didn't look right, so we decided that tests are ok to be long.

## cyclomatic_complexity

State: **Disabled**.

Since we're not using the `function_lines_of_code` rule, the `main()` function in tests can have high cyclomatic complexity. For the rationale against splitting up `main()` in tests, see the comments for `function_lines_of_code` above.

## prefer_match_file_name

State: **Disabled**.
Expand Down
4 changes: 2 additions & 2 deletions doc/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.1.0",
"@docusaurus/preset-classic": "^3.1.0",
"@docusaurus/core": "^3.10.1",
"@docusaurus/preset-classic": "^3.10.1",
"@easyops-cn/docusaurus-search-local": "^0.40.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.1.0",
Expand Down
Loading