Add intro and mention IRC in CONTRIBUTING.md

This is partly taken from the [rustfmt CONTRIBUTING.md][contrib].

[contrib]: https://github.com/rust-lang-nursery/rustfmt/blob/master/Contributing.md
This commit is contained in:
Philipp Hansch 2018-04-17 08:33:22 +02:00
parent ae3213747d
commit fe426b7c51
No known key found for this signature in database
GPG Key ID: B6FA06A6E0E2665B

View File

@ -2,6 +2,13 @@
Hello fellow Rustacean! Great to see your interest in compiler internals and lints! Hello fellow Rustacean! Great to see your interest in compiler internals and lints!
Clippy welcomes contributions from everyone. There are many ways to contribute to Clippy and the following document explains how
you can contribute and how to get started.
If you have any questions about contributing or need help with anything, feel free to ask questions on issues or
visit the `#clippy` IRC channel on `irc.mozilla.org`.
All contributors are expected to follow the [Rust Code of Conduct](http://www.rust-lang.org/conduct.html).
## Getting started ## Getting started
High level approach: High level approach:
@ -56,7 +63,7 @@ of this.
There is also the internal `author` lint to generate clippy code that detects the offending pattern. It does not work for all of the Rust syntax, but can give a good starting point. There is also the internal `author` lint to generate clippy code that detects the offending pattern. It does not work for all of the Rust syntax, but can give a good starting point.
Create a new UI test with the pattern you want to match: First, create a new UI test file in the `tests/ui/` directory with the pattern you want to match:
```rust ```rust
// ./tests/ui/my_lint.rs // ./tests/ui/my_lint.rs
@ -71,7 +78,7 @@ fn main() {
``` ```
Now you run `TESTNAME=ui/my_lint cargo test --test compile-test` to produce Now you run `TESTNAME=ui/my_lint cargo test --test compile-test` to produce
the file with the generated code: a `.stdout` file with the generated code:
```rust ```rust
// ./tests/ui/my_lint.stdout // ./tests/ui/my_lint.stdout
@ -87,6 +94,8 @@ if_chain! {
} }
``` ```
If the command was executed successfully, you can copy the code over to where you are implementing your lint.
#### Documentation #### Documentation
Please document your lint with a doc comment akin to the following: Please document your lint with a doc comment akin to the following:
@ -140,17 +149,10 @@ enabled as a plugin:
## Contributions ## Contributions
Clippy welcomes contributions from everyone.
Contributions to Clippy should be made in the form of GitHub pull requests. Each pull request will Contributions to Clippy should be made in the form of GitHub pull requests. Each pull request will
be reviewed by a core contributor (someone with permission to land patches) and either landed in the be reviewed by a core contributor (someone with permission to land patches) and either landed in the
main tree or given feedback for changes that would be required. main tree or given feedback for changes that would be required.
All code in this repository is under the [Mozilla Public License, 2.0](https://www.mozilla.org/MPL/2.0/) All code in this repository is under the [Mozilla Public License, 2.0](https://www.mozilla.org/MPL/2.0/)
## Conduct
We follow the [Rust Code of Conduct](http://www.rust-lang.org/conduct.html).
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md --> <!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->