Skip to content

Commit 9e260c4

Browse files
committed
Document our approach to clippy lints
1 parent e6c0a3c commit 9e260c4

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

CONTRIBUTING.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
1. Fork it!
44
2. Create your feature branch: `git checkout -b my-new-feature`
5-
3. Commit your changes: `git commit -am 'Add some feature'`
6-
4. Push to the branch: `git push origin my-new-feature`
7-
5. Submit a pull request :D
5+
3. Test it: `cargo test`
6+
4. Lint it: `cargo +nightly clippy --all-targets -- -D warnings`
7+
5. Commit your changes: `git commit -am 'Add some feature'`
8+
6. Push to the branch: `git push origin my-new-feature`
9+
7. Submit a pull request :D
810

911
For developing on `rustup` itself, you may want to install into a temporary
1012
directory, with a series of commands similar to this:
@@ -60,6 +62,34 @@ The `rustup::currentprocess` module abstracts the global state that is
6062
`std::env::current_dir` and `std::process::exit` permitting threaded tests of
6163
the CLI logic; use `process()` rather than those APIs directly.
6264

65+
### Clippy lints
66+
67+
We do not enforce lint status in the checks done by GitHub Actions, because
68+
clippy is a moving target that can make it hard to merge for little benefit.
69+
70+
We do ask that contributors keep the clippy status clean themselves.
71+
72+
Minimally, run `cargo +nightly clippy --all-targets -- -D warnings` before
73+
submitting code.
74+
75+
Regular contributors or contributors to particularly OS-specific code should
76+
also make sure that their clippy checking is done on at least Linux and Windows,
77+
as OS-conditional code is a common source of unused imports and other small
78+
lints, which can build up over time.
79+
80+
For developers using BSD/Linux/Mac OS, there are Windows VM's suitable for such
81+
development tasks for use with virtualbox and other hypervisors are downloadable
82+
from
83+
[Microsoft](https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/).
84+
Similarly, there are many Linux and Unix operating systems images available for
85+
developers whose usual operating system is Windows. Currently Rustup has no Mac
86+
OS specific code, so there should be no need to worry about Mac VM images.
87+
88+
Clippy is also run in GitHub Actions, in the 'General Checks / Checks` build
89+
task, but not currently run per-platform, which means there is no way to find
90+
out the status of clippy per platform without running it on that platform as a
91+
developer.
92+
6393
## Version numbers
6494

6595
If you ever see a released version of rustup which has `::` in its version string

0 commit comments

Comments
 (0)