diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8353d6..895eb77 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,6 +17,18 @@ but we still recommend to file an issue detailing what you’re fixing. This is helpful in case we don’t accept that specific fix but want to keep track of the issue. +## Contributing new Dart lint rules + +If you intend to provide changes related to a new Dart version you can follow these steps: + +1. Ensure you are on the latest stable Dart version. +1. Run `dart tool/bump_version/main.dart ` to generate a new version. +1. Add or remove the lint rules you want to change in the version file you generated in step 2. + > 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. +1. Open a terminal in `tool/linter_rules` and run `dart lib/exclusion_reason_table.dart` to generate an up-to-date exclusion table. +1. Document the rules that were removed with a reason as to why, if there is any. + > Link to an issue as to why a lint rule should not be used if there is any. + ## Creating a Pull Request 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 ### Release a new version +Skip step `1` if a new version file was already generated. + 1. Run the `bump_version` script with the desired new version as an argument: -```sh -dart tool/bump_version/main.dart -``` + ```sh + dart tool/bump_version/main.dart + ``` -Where `` is the new version to be released in the format `x.y.z`. + Where `` is the new version to be released in the format `x.y.z`. -This script will: + This script will: -- Copy the most recent yaml to a new one with the new desired version. -- Include that file on the main yaml file `lib/analysis_options.yaml`. + - Copy the most recent yaml to a new one with the new desired version. + - Include that file on the main yaml file `lib/analysis_options.yaml`. 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. 1. Open a pull request with the proposed changes.