mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
chore: Updated contributing instructions and justfile
This commit is contained in:
parent
b3aa4540cb
commit
c799e8d0ca
3 changed files with 21 additions and 99 deletions
21
.github/CONTRIBUTING.md
vendored
21
.github/CONTRIBUTING.md
vendored
|
@ -9,8 +9,8 @@ Another really great way to help is if you find an interesting, or helpful way i
|
|||
To test with all features both enabled and disabled, you can run these commands:
|
||||
|
||||
```sh
|
||||
$ cargo test --no-default-features
|
||||
$ cargo test --features "yaml unstable"
|
||||
$ cargo test --all --no-default-features
|
||||
$ cargo test --all --features "yaml unstable"
|
||||
```
|
||||
|
||||
Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the prebuilt recipes. *Not* using `just` is perfectly fine as well, it simply bundles commands automatically.
|
||||
|
@ -26,7 +26,7 @@ From here on, I will list the appropriate `cargo` command as well as the `just`
|
|||
Sometimes it's helpful to only run a subset of the tests, which can be done via:
|
||||
|
||||
```sh
|
||||
$ cargo test --test <test_name>
|
||||
$ cargo test --all --test <test_name>
|
||||
|
||||
# Or
|
||||
|
||||
|
@ -35,14 +35,13 @@ $ just run-test <test_name>
|
|||
|
||||
### Linting Code
|
||||
|
||||
During the CI process `clap` runs against many different lints using [`clippy`](https://github.com/Manishearth/rust-clippy). In order to check if these lints pass on your own computer prior to submitting a PR you'll need a nightly compiler.
|
||||
During the CI process `clap` runs against many different lints using [`clippy`](https://github.com/rust-lang/rust-clippy).
|
||||
|
||||
In order to check the code for lints run either:
|
||||
In order to check the code for lints and to format it run either:
|
||||
|
||||
```sh
|
||||
$ rustup override add nightly
|
||||
$ cargo build --features lints
|
||||
$ rustup override remove
|
||||
$ cargo clippy --all --all-features -- -D warnings
|
||||
$ cargo fmt
|
||||
|
||||
# Or
|
||||
|
||||
|
@ -54,10 +53,10 @@ $ just lint
|
|||
Another helpful technique is to see the `clap` debug output while developing features. In order to see the debug output while running the full test suite or individual tests, run:
|
||||
|
||||
```sh
|
||||
$ cargo test --features debug
|
||||
$ cargo test --all --features debug
|
||||
|
||||
# Or for individual tests
|
||||
$ cargo test --test <test_name> --features debug
|
||||
$ cargo test --all --test <test_name> --features debug
|
||||
|
||||
# The corresponding just command for individual debugging tests is:
|
||||
$ just debug <test_name>
|
||||
|
@ -81,7 +80,7 @@ I use a [conventional](https://github.com/ajoslin/conventional-changelog/blob/a5
|
|||
- `wip` - A work in progress commit (Should typically be `git rebase`'ed away)
|
||||
- `chore` - Catch all or things that have to do with the build system, etc
|
||||
- `examples` - Changes to existing example, or a new example
|
||||
* The `COMPONENT` is optional, and may be a single file, directory, or logical component. Parenthesis can be omitted if you are opting not to use the `COMPONENT`.
|
||||
* The `COMPONENT` is optional, and may be a single file, directory, or logical component. Parenthesis can be omitted if you are opting not to use the `COMPONENT`.
|
||||
|
||||
### Tests and Documentation
|
||||
|
||||
|
|
23
justfile
23
justfile
|
@ -13,25 +13,22 @@
|
|||
rm CONTRIBUTORS.md.bak
|
||||
|
||||
run-test TESTG TEST="":
|
||||
cargo test --test {{TESTG}} -- {{TEST}}
|
||||
cargo test --all --test {{TESTG}} -- {{TEST}}
|
||||
|
||||
debug TESTG TEST="":
|
||||
cargo test --test {{TESTG}} --features debug -- {{TEST}}
|
||||
cargo test --all --test {{TESTG}} --features debug -- {{TEST}}
|
||||
|
||||
run-tests:
|
||||
cargo test --features "yaml unstable"
|
||||
cargo test --all --features "yaml unstable"
|
||||
|
||||
@bench: nightly
|
||||
cargo bench && just remove-nightly
|
||||
@bench:
|
||||
cargo bench
|
||||
|
||||
nightly:
|
||||
rustup override add nightly
|
||||
|
||||
remove-nightly:
|
||||
rustup override remove
|
||||
|
||||
@lint: nightly
|
||||
cargo build --features lints && just remove-nightly
|
||||
@lint:
|
||||
rustup add component clippy
|
||||
rustup add component rustfmt
|
||||
cargo clippy --all --all-features -- -D warnings
|
||||
cargo fmt
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
|
|
76
src/lib.rs
76
src/lib.rs
|
@ -373,81 +373,7 @@
|
|||
//!
|
||||
//! ## How to Contribute
|
||||
//!
|
||||
//! Contributions are always welcome! And there is a multitude of ways in which you can help
|
||||
//! depending on what you like to do, or are good at. Anything from documentation, code cleanup,
|
||||
//! issue completion, new features, you name it, even filing issues is contributing and greatly
|
||||
//! appreciated!
|
||||
//!
|
||||
//! Another really great way to help is if you find an interesting, or helpful way in which to use
|
||||
//! `clap`. You can either add it to the [examples/] directory, or file an issue and tell
|
||||
//! me. I'm all about giving credit where credit is due :)
|
||||
//!
|
||||
//! Please read [CONTRIBUTING.md](https://raw.githubusercontent.com/kbknapp/clap-rs/master/.github/CONTRIBUTING.md) before you start contributing.
|
||||
//!
|
||||
//!
|
||||
//! ### Testing Code
|
||||
//!
|
||||
//! To test with all features both enabled and disabled, you can run theese commands:
|
||||
//!
|
||||
//! ```text
|
||||
//! $ cargo test --no-default-features
|
||||
//! $ cargo test --features "yaml unstable"
|
||||
//! ```
|
||||
//!
|
||||
//! Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the
|
||||
//! prebuilt recipies. *Not* using `just` is perfectly fine as well, it simply bundles commands
|
||||
//! automatically.
|
||||
//!
|
||||
//! For example, to test the code, as above simply run:
|
||||
//!
|
||||
//! ```text
|
||||
//! $ just run-tests`
|
||||
//! ```
|
||||
//!
|
||||
//! From here on, I will lis the appropriate `cargo` command as well as the `just` command.
|
||||
//!
|
||||
//! Sometimes it's helpful to only run a subset of the tests, which can be done via:
|
||||
//!
|
||||
//! ```text
|
||||
//! $ cargo test --test <test_name>
|
||||
//!
|
||||
//! # Or
|
||||
//!
|
||||
//! $ just run-test <test_name>
|
||||
//! ```
|
||||
//!
|
||||
//! ### Linting Code
|
||||
//!
|
||||
//! During the CI process `clap` runs against many different lints using
|
||||
//! [`clippy`](https://github.com/Manishearth/rust-clippy). In order to check if these lints pass on
|
||||
//! your own computer prior to submitting a PR you'll need a nightly compiler.
|
||||
//!
|
||||
//! In order to check the code for lints run either:
|
||||
//!
|
||||
//! ```text
|
||||
//! $ rustup override add nightly
|
||||
//! $ cargo build --features lints
|
||||
//! $ rustup override remove
|
||||
//!
|
||||
//! # Or
|
||||
//!
|
||||
//! $ just lint
|
||||
//! ```
|
||||
//!
|
||||
//! ### Debugging Code
|
||||
//!
|
||||
//! Another helpful technique is to see the `clap` debug output while developing features. In order
|
||||
//! to see the debug output while running the full test suite or individual tests, run:
|
||||
//!
|
||||
//! ```text
|
||||
//! $ cargo test --features debug
|
||||
//!
|
||||
//! # Or for individual tests
|
||||
//! $ cargo test --test <test_name> --features debug
|
||||
//!
|
||||
//! # The corresponding just command for individual debugging tests is:
|
||||
//! $ just debug <test_name>
|
||||
//! ```
|
||||
//! Please read [CONTRIBUTING.md](https://raw.githubusercontent.com/clap-rs/clap/master/.github/CONTRIBUTING.md) before you start contributing.
|
||||
//!
|
||||
//! ### Goals
|
||||
//!
|
||||
|
|
Loading…
Reference in a new issue