Skip to content

Commit 1a05d9e

Browse files
authored
Link to 'dart fix' docs in table header (dart-archive/lints#132)
* Link to 'dart fix' docs in table header * Update doc generation script
1 parent e59a008 commit 1a05d9e

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

pkgs/lints/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ To use these lints create an `analysis_options.yaml` file with:
100100
`include: package:lints/core.yaml`.
101101
102102
<!-- core -->
103-
| Lint Rules | Description | Fix |
104-
| :--------- | :---------- | --- |
103+
| Lint Rules | Description | [Fix][] |
104+
| :--------- | :---------- | ------- |
105105
| [`avoid_empty_else`](https://dart.dev/lints/avoid_empty_else) | Avoid empty else statements. | ✅ |
106106
| [`avoid_relative_lib_imports`](https://dart.dev/lints/avoid_relative_lib_imports) | Avoid relative imports for files in `lib/`. | ✅ |
107107
| [`avoid_shadowing_type_parameters`](https://dart.dev/lints/avoid_shadowing_type_parameters) | Avoid shadowing type parameters. | |
@@ -138,8 +138,8 @@ To use these lints create an `analysis_options.yaml` file with:
138138
`include: package:lints/recommended.yaml`.
139139
140140
<!-- recommended -->
141-
| Lint Rules | Description | Fix |
142-
| :--------- | :---------- | --- |
141+
| Lint Rules | Description | [Fix][] |
142+
| :--------- | :---------- | ------- |
143143
| [`annotate_overrides`](https://dart.dev/lints/annotate_overrides) | Annotate overridden members. | ✅ |
144144
| [`avoid_function_literals_in_foreach_calls`](https://dart.dev/lints/avoid_function_literals_in_foreach_calls) | Avoid using `forEach` with a function literal. | ✅ |
145145
| [`avoid_init_to_null`](https://dart.dev/lints/avoid_init_to_null) | Don't explicitly initialize variables to null. | ✅ |
@@ -206,3 +206,4 @@ To use these lints create an `analysis_options.yaml` file with:
206206
[linter repo]: https://github.com/dart-lang/linter
207207
[`package:pedantic`]: https://pub.dev/packages/pedantic
208208
[`package:flutter_lints`]: https://pub.dev/packages/flutter_lints
209+
[Fix]: https://dart.dev/tools/dart-fix

pkgs/lints/tool/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
## `tool/validate_lib.dart`
33

4-
This tool ensures that we don't commit `.dart` source files into the lib/
4+
This tool ensures that we don't commit `.dart` source files into the `lib/`
55
directory; it's automatically run by the CI. To run manually:
66

7-
```
8-
dart tool/validate_lib.dart
7+
```shell
8+
dart run tool/validate_lib.dart
99
```
1010

1111
## `tool/gen_docs.dart`
1212

1313
This tool regenerates the lists of core and recommended lints into the package's
14-
README.md file. To use it, run:
14+
`README.md` file. To use it, run:
1515

16-
```
17-
dart tool/gen_docs.dart
16+
```shell
17+
dart run tool/gen_docs.dart
1818
```
1919

2020
It can also validate that the readme file is up-to-date. It's automatically
2121
run by the CI; to run it manually:
2222

23-
```
24-
dart tool/gen_docs.dart --verify
23+
```shell
24+
dart run tool/gen_docs.dart --verify
2525
```

pkgs/lints/tool/gen_docs.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ String _createRuleTable(
8484
rules.sort();
8585

8686
final lines = [
87-
'| Lint Rules | Description | Fix |',
88-
'| :--------- | :---------- | --- |',
87+
'| Lint Rules | Description | [Fix][] |',
88+
'| :--------- | :---------- | ------- |',
8989
...rules.map((rule) {
9090
final ruleMeta =
9191
lintMeta.firstWhereOrNull((meta) => meta['name'] == rule);

0 commit comments

Comments
 (0)