Skip to content
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
6 changes: 6 additions & 0 deletions packages/altive_lints/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!-- cSpell:words masa -->
## 2.0.0-dev.3

- **DOCS**: Fix the notation for enabling the plugin in README.md.
- **FIX**: Change plugin specification in altive_lints from path to version.

## 2.0.0-dev.2

- **FIX**: Changed the AnalysisRule that had been registered as a Warning rule to be registered as a Lint rule.
Expand Down
18 changes: 11 additions & 7 deletions packages/altive_lints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@ Provides `all_lint_rules.yaml` that activates all lint rules and `altive_lints.y
### altive_lints

1. Add altive_lints to your `pubspec.yaml`:
```yaml
dev_dependencies:
altive_lints:
```
```yaml
dev_dependencies:
altive_lints:
```
2. Include altive_lints in analysis_options.yaml.<br/>
If not, create a new one or copy [analysis_options.yaml](https://github.com/altive/altive_lints/blob/main/packages/altive_lints/example/analysis_options.yaml) and use it.

```yaml
include: package:altive_lints/altive_lints.yaml
```
```yaml
include: package:altive_lints/altive_lints.yaml
plugins:
altive_lints:
version: ^2.0.0-dev.3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the version number in the documentation can become a maintenance burden, as it will need to be updated with every new release. To avoid this, consider using a placeholder like <latest_version> and instructing users to find the latest version on pub.dev.

Suggested change
version: ^2.0.0-dev.3
version: <latest_version>

```

### Disabling lint rules/analysis rules

Expand All @@ -60,6 +63,7 @@ linter:

plugins:
altive_lints:
version: ^2.0.0-dev.3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the previous comment, hardcoding the version here can lead to outdated documentation. Using a placeholder would be more maintainable in the long run.

Suggested change
version: ^2.0.0-dev.3
version: <latest_version>

diagnostics:
# Explicitly disable one analysis rule.
avoid_consecutive_sliver_to_box_adapter: false
Expand Down
2 changes: 1 addition & 1 deletion packages/altive_lints/lib/altive_lints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ formatter:

plugins:
altive_lints:
path: ../../altive_lints
version: ^2.0.0-dev.3
diagnostics:
avoid_consecutive_sliver_to_box_adapter: true
avoid_hardcoded_color: true
Expand Down
25 changes: 14 additions & 11 deletions packages/altive_lints/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:analysis_server_plugin/plugin.dart';
import 'package:analysis_server_plugin/registry.dart';
import 'package:analyzer/analysis_rule/analysis_rule.dart';

import 'src/assists/add_macro_document_comments.dart';
import 'src/assists/add_macro_template_document_comment.dart';
Expand All @@ -25,19 +26,21 @@ class _Plugin extends Plugin {

@override
Future<void> register(PluginRegistry registry) async {
<AnalysisRule>[
AvoidConsecutiveSliverToBoxAdapter(),
AvoidHardcodedColor(),
AvoidHardcodedJapanese(),
AvoidShrinkWrapInListView(),
AvoidSingleChild(),
PreferClockNow(),
PreferDedicatedMediaQueryMethods(),
PreferSpaceBetweenElements(),
PreferToIncludeSliverInName(),
].forEach(registry.registerLintRule);

registry
..registerLintRule(AvoidConsecutiveSliverToBoxAdapter())
..registerLintRule(AvoidHardcodedColor())
..registerLintRule(AvoidHardcodedJapanese())
..registerLintRule(AvoidShrinkWrapInListView())
..registerLintRule(AvoidSingleChild())
..registerLintRule(PreferClockNow())
..registerLintRule(PreferDedicatedMediaQueryMethods())
..registerLintRule(PreferSpaceBetweenElements())
..registerLintRule(PreferToIncludeSliverInName())
..registerAssist(AddMacroDocumentComment.new)
..registerAssist(AddMacroTemplateDocumentComment.new)
..registerAssist(WrapWithMacroTemplateDocumentComment.new)
/* */;
..registerAssist(WrapWithMacroTemplateDocumentComment.new);
}
}
7 changes: 5 additions & 2 deletions packages/altive_lints/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: altive_lints
description: >-
Provides `all_lint_rules.yaml` that activates all rules and
`altive_lints.yaml` with Altive recommended rule selection.
version: 2.0.0-dev.2
version: 2.0.0-dev.3
homepage: https://altive.dev
repository: https://github.com/altive/altive_lints
issue_tracker: https://github.com/altive/altive_lints/issues
topics:
- lint
- lints
- linter
- code-style
- analysis
- analyzer
- lints

resolution: workspace

Expand Down