You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Also, consider taking up a valuable, reviewed, but abandoned pull request which
34
34
* Make sure your PR includes a [changelog fragment](https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).
35
35
* You must not include a fragment for new modules or new plugins. Also you shouldn't include one for docs-only changes. (If you're not sure, simply don't include one, we'll tell you whether one is needed or not :) )
36
36
* Please always include a link to the pull request itself, and if the PR is about an issue, also a link to the issue. Also make sure the fragment ends with a period, and begins with a lower-case letter after `-`. (Again, if you don't do this, we'll add suggestions to fix it, so don't worry too much :) )
37
-
*Avoid reformatting unrelated parts of the codebase in your PR. These types of changes will likely be requested for reversion, create additional work for reviewers, and may cause approval to be delayed.
37
+
*Note that we format the code with `ruff format`. If your change does not match the formatters expectations, CI will fail and your PR will not get merged. See below for how to format code with antsibull-nox.
38
38
39
39
You can also read [our Quick-start development guide](https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst).
40
40
@@ -44,11 +44,24 @@ If you want to test a PR locally, refer to [our testing guide](https://github.co
44
44
45
45
If you find any inconsistencies or places in this document which can be improved, feel free to raise an issue or pull request to fix it.
46
46
47
-
## Run sanity or unit locally (with antsibull-nox)
47
+
## Format code; and run sanity or unit tests locally (with antsibull-nox)
48
48
49
-
The easiest way to run sanity and unit tests locally is to use [antsibull-nox](https://ansible.readthedocs.io/projects/antsibull-nox/).
49
+
The easiest way to format the code, and to run sanity and unit tests locally is to use [antsibull-nox](https://ansible.readthedocs.io/projects/antsibull-nox/).
50
50
(If you have [nox](https://nox.thea.codes/en/stable/) installed, it will automatically install antsibull-nox in a virtual environment for you.)
51
51
52
+
### Format code
53
+
54
+
The following commands show how to run ansible-test sanity tests:
55
+
56
+
```.bash
57
+
# Run all configured formatters:
58
+
nox -Re formatters
59
+
60
+
# If you notice discrepancies between your local formatter and CI, you might
61
+
# need to re-generate the virtual environment:
62
+
nox -e formatters
63
+
```
64
+
52
65
### Sanity tests
53
66
54
67
The following commands show how to run ansible-test sanity tests:
0 commit comments