Remove unstable feature flag

This commit is contained in:
Pavan Kumar Sunkara 2021-03-13 11:40:56 +05:30
parent 7442de7d9a
commit 49954c28ad
9 changed files with 17 additions and 19 deletions

View file

@ -34,5 +34,5 @@ stages:
displayName: Install rust displayName: Install rust
- script: cargo test --no-default-features --features "std cargo" -p clap:3.0.0-beta.2 - script: cargo test --no-default-features --features "std cargo" -p clap:3.0.0-beta.2
displayName: Test with almost no features displayName: Test with almost no features
- script: cargo test --features "yaml unstable" - script: cargo test --features "yaml"
displayName: Test with most features displayName: Test with most features

View file

@ -76,7 +76,9 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install linker - name: Install linker
if: matrix.target == 'i686-unknown-linux-gnu' if: matrix.target == 'i686-unknown-linux-gnu'
run: sudo apt-get install gcc-multilib run: |
sudo apt-get update
sudo apt-get install gcc-multilib
- name: Test almost no features - name: Test almost no features
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
if: matrix.features == 'none' if: matrix.features == 'none'
@ -88,19 +90,19 @@ jobs:
if: matrix.features == 'all' if: matrix.features == 'all'
with: with:
command: test command: test
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable" args: --target ${{ matrix.target }} --features "wrap_help yaml regex"
- name: Check debug statement - name: Check debug statement
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
if: matrix.features == 'all' if: matrix.features == 'all'
with: with:
command: check command: check
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable debug" args: --target ${{ matrix.target }} --features "wrap_help yaml regex debug"
- name: Test release - name: Test release
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
if: matrix.features == 'release' if: matrix.features == 'release'
with: with:
command: test command: test
args: --target ${{ matrix.target }} --features "wrap_help yaml regex unstable" --release args: --target ${{ matrix.target }} --features "wrap_help yaml regex" --release
nightly: nightly:
name: Nightly Tests name: Nightly Tests
needs: [prepare] needs: [prepare]
@ -123,7 +125,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --features "wrap_help yaml regex unstable" args: --features "wrap_help yaml regex"
wasm: wasm:
name: Wasm Check name: Wasm Check
needs: [prepare] needs: [prepare]
@ -145,7 +147,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: check command: check
args: --target ${{ matrix.target }} --features "yaml regex unstable" args: --target ${{ matrix.target }} --features "yaml regex"
lint: lint:
name: Linting (fmt + clippy) name: Linting (fmt + clippy)
needs: [prepare] needs: [prepare]
@ -169,7 +171,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: clippy command: clippy
args: --features "wrap_help yaml regex unstable" -- -D warnings args: --features "wrap_help yaml regex" -- -D warnings
- name: Format check - name: Format check
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
@ -199,7 +201,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: tarpaulin command: tarpaulin
args: --features "wrap_help yaml regex unstable" --timeout 300 --out Lcov --output-dir coverage args: --features "wrap_help yaml regex" --timeout 300 --out Lcov --output-dir coverage
- name: Coveralls - name: Coveralls
uses: coverallsapp/github-action@master uses: coverallsapp/github-action@master
with: with:

View file

@ -9,7 +9,7 @@ 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: To test with all features both enabled and disabled, you can run these commands:
```sh ```sh
$ cargo test --features "wrap_help yaml regex unstable" $ cargo test --features "wrap_help yaml regex"
``` ```
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. 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.
@ -39,7 +39,7 @@ During the CI process `clap` runs against many different lints using [`clippy`](
In order to check the code for lints and to format it run either: In order to check the code for lints and to format it run either:
```sh ```sh
$ cargo clippy --features "wrap_help yaml regex unstable" -- -D warnings $ cargo clippy --features "wrap_help yaml regex" -- -D warnings
$ cargo fmt -- --check $ cargo fmt -- --check
# Or # Or
@ -84,7 +84,7 @@ I use a [conventional](https://github.com/ajoslin/conventional-changelog/blob/a5
### Tests and Documentation ### Tests and Documentation
1. Create tests for your changes 1. Create tests for your changes
2. **Ensure the tests are passing.** Run the tests (`cargo test --features "yaml unstable"`), alternatively `just run-tests` if you have `just` installed. 2. **Ensure the tests are passing.** Run the tests (`cargo test --features "yaml"`), alternatively `just run-tests` if you have `just` installed.
3. **Optional** Run the lints (`cargo build --features lints`) (requires a nightly compiler), alternatively `just lint` 3. **Optional** Run the lints (`cargo build --features lints`) (requires a nightly compiler), alternatively `just lint`
4. Ensure your changes contain documentation if adding new APIs or features. 4. Ensure your changes contain documentation if adding new APIs or features.

View file

@ -95,7 +95,6 @@ unicode_help= ["textwrap/unicode-width"] # Enable if any unicode in help messag
derive = ["clap_derive", "lazy_static"] derive = ["clap_derive", "lazy_static"]
yaml = ["yaml-rust"] yaml = ["yaml-rust"]
cargo = ["lazy_static"] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros cargo = ["lazy_static"] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
unstable = ["clap_derive/unstable"] # for building with unstable clap features (doesn't require nightly Rust) (currently none)
debug = ["clap_derive/debug"] # Enables debug messages debug = ["clap_derive/debug"] # Enables debug messages
doc = ["yaml", "regex"] # All the features which add to documentation doc = ["yaml", "regex"] # All the features which add to documentation

View file

@ -491,7 +491,6 @@ features = [ "suggestions", "color" ]
* **"wrap_help"**: Turns on the help text wrapping feature, based on the terminal size. (builds dependency `term-size`) * **"wrap_help"**: Turns on the help text wrapping feature, based on the terminal size. (builds dependency `term-size`)
* **"yaml"**: Enables building CLIs from YAML documents. (builds dependency `yaml-rust`) * **"yaml"**: Enables building CLIs from YAML documents. (builds dependency `yaml-rust`)
* **"regex"**: Enables regex validators. (builds dependency `regex`) * **"regex"**: Enables regex validators. (builds dependency `regex`)
* **"unstable"**: Enables unstable `clap` features that may change from release to release
### More Information ### More Information

View file

@ -51,7 +51,6 @@ version-sync = "0.9"
[features] [features]
default = [] default = []
unstable = []
debug = [] debug = []
doc = [] doc = []

View file

@ -43,7 +43,6 @@ version-sync = "0.9"
[features] [features]
default = [] default = []
unstable = ["clap/unstable"]
debug = ["clap/debug"] debug = ["clap/debug"]
doc = [] doc = []

View file

@ -5,7 +5,7 @@ debug TESTG TEST="":
cargo test --test {{TESTG}} --features debug -- {{TEST}} cargo test --test {{TESTG}} --features debug -- {{TEST}}
run-tests: run-tests:
cargo test --features "wrap_help yaml regex unstable" cargo test --features "wrap_help yaml regex"
@bench: @bench:
cargo bench cargo bench
@ -13,7 +13,7 @@ run-tests:
@lint: @lint:
rustup component add clippy rustup component add clippy
rustup component add rustfmt rustup component add rustfmt
cargo clippy --features "wrap_help yaml regex unstable" -- -D warnings cargo clippy --features "wrap_help yaml regex" -- -D warnings
cargo fmt -- --check cargo fmt -- --check
clean: clean:

View file

@ -10,7 +10,7 @@ fn run_example<S: AsRef<str>>(name: S, args: &[&str]) -> Output {
"--example", "--example",
name.as_ref(), name.as_ref(),
"--features", "--features",
"yaml unstable", "yaml",
"--", "--",
]; ];
all_args.extend_from_slice(args); all_args.extend_from_slice(args);