Skip to content

Commit 447051a

Browse files
author
Jochum van der Ploeg
authored
docs: update CONTRIBUTING.md to explain how to add new lint rules (#156)
1 parent efa405e commit 447051a

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ but we still recommend to file an issue detailing what you’re fixing.
1717
This is helpful in case we don’t accept that specific fix but want to keep
1818
track of the issue.
1919

20+
## Contributing new Dart lint rules
21+
22+
If you intend to provide changes related to a new Dart version you can follow these steps:
23+
24+
1. Ensure you are on the latest stable Dart version.
25+
1. Run `dart tool/bump_version/main.dart <NEW_VERSION>` to generate a new version.
26+
1. Add or remove the lint rules you want to change in the version file you generated in step 2.
27+
> To find new rules more easily you can run the same command as in step 4 which will add new rules directly to the exclusion table.
28+
1. Open a terminal in `tool/linter_rules` and run `dart lib/exclusion_reason_table.dart` to generate an up-to-date exclusion table.
29+
1. Document the rules that were removed with a reason as to why, if there is any.
30+
> Link to an issue as to why a lint rule should not be used if there is any.
31+
2032
## Creating a Pull Request
2133

2234
Before creating a pull request please:
@@ -44,18 +56,20 @@ Every snapshot of a version is saved on its own yaml file under the name pattern
4456

4557
### Release a new version
4658

59+
Skip step `1` if a new version file was already generated.
60+
4761
1. Run the `bump_version` script with the desired new version as an argument:
4862

49-
```sh
50-
dart tool/bump_version/main.dart <version>
51-
```
63+
```sh
64+
dart tool/bump_version/main.dart <version>
65+
```
5266

53-
Where `<version>` is the new version to be released in the format `x.y.z`.
67+
Where `<version>` is the new version to be released in the format `x.y.z`.
5468

55-
This script will:
69+
This script will:
5670

57-
- Copy the most recent yaml to a new one with the new desired version.
58-
- Include that file on the main yaml file `lib/analysis_options.yaml`.
71+
- Copy the most recent yaml to a new one with the new desired version.
72+
- Include that file on the main yaml file `lib/analysis_options.yaml`.
5973

6074
1. Update the `README.md` exclusion table, refer to the ["Exclusion Reason Table 🗞️👨‍⚖️"](tool/linter_rules/README.md#exclusion-reason-table-️️) documentation for more information.
6175
1. Open a pull request with the proposed changes.

0 commit comments

Comments
 (0)