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
17 changes: 12 additions & 5 deletions tool/linter_rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Rules that are missing a reason in the `exclusion_reasons.json` file will be giv
| set-exit-if-changed | Set the exit code to 2 if there are changes to the exclusion reasons. | false |


## Inspection 🔍
## Analyze 🔍

If you're looking to update Very Good Analysis you might want to inspect the health of the latest rule set. You can use the script at `bin/inspect.dart` to do exactly that.
If you're looking to update Very Good Analysis you might want to analyze the health of the latest rule set. You can use the script at `bin/analyze.dart` to do exactly that.

It will log information about:

Expand All @@ -48,10 +48,17 @@ It will log information about:

### Usage

To run the `inspect` script, run the following command (from `tool/linter_rules`, and don't forget to `dart pub get`):
To run the `analyze` script, run the following command (from `tool/linter_rules`, and don't forget to `dart pub get`):

```sh
dart bin/inspect.dart $version
# This will analyze the latest version of Very Good Analysis
dart bin/analyze.dart
```

Where version is the existing Very Good Analysis version you would like to inspect, for example `9.0.0`.
The script also accepts a specific version as an argument to analyze:

```sh
dart bin/analyze.dart $version
```

Where version is the existing Very Good Analysis version you would like to analyze, for example `9.0.0`.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@ final Uri _allLinterRulesUri = Uri.parse(

/// Compares Very Good Analysis with the all available Dart linter rules.
///
/// Should be run from the root of the `linter_rules` package (tool/linter_rules),
/// with the version of the Very Good Analysis to inspect.
/// Should be run from the root of the `linter_rules` package (tool/linter_rules).
///
/// The version argument should be in the format of `x.y.z`. For example,
/// `5.1.0`.
///
/// To use the tool run (from tool/linter_rules):
/// ```sh
/// dart bin/inspect.dart $version
/// dart bin/analyze.dart
/// ```
///
/// Where `$version` is the version of the Very Good Analysis to log the table
/// for. For example:
/// A specific version can be analyzed by providing it as an argument,
/// otherwise the latest version will be used.
///
/// For example, to analyze version `5.1.0`:
///
/// ```sh
/// dart bin/inspect.dart 5.1.0
/// dart bin/analyze.dart 5.1.0
/// ```
///
/// It will log information about:
Expand All @@ -38,7 +37,7 @@ Future<void> main(
List<String> args, {
void Function(String) log = print,
}) async {
final version = args[0];
final version = args.isNotEmpty ? args[0] : latestVgaVersion();

final response = await get(_allLinterRulesUri);
final json = jsonDecode(response.body) as List<dynamic>;
Expand Down