Skip to content

Commit

Permalink
Merge pull request #3101 from epage/features
Browse files Browse the repository at this point in the history
docs: Auto-tag feature flags
  • Loading branch information
epage authored Dec 9, 2021
2 parents f83ead6 + d42cfee commit 3b5c5c7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ jobs:
- name: Lint (minimal)
run: make clippy-minimal
- name: Lint (all)
run: make clippy-all
run: make clippy-full
2 changes: 1 addition & 1 deletion .github/workflows/rust-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ jobs:
- name: Lint Minimal
run: make clippy-minimal
- name: Lint All
run: make clippy-all
run: make clippy-full
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ include = [
]

[package.metadata.docs.rs]
features = ["doc"]
features = ["unstable-doc"]
rustc-args = ["--cfg", "docsrs"]
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples=examples"]

[package.metadata.playground]
features = ["doc"]
features = ["unstable-doc"]

[package.metadata.release]
shared-version = true
Expand All @@ -57,7 +58,7 @@ default = [
"suggestions",
]
debug = ["clap_derive/debug", "backtrace"] # Enables debug messages
doc = ["derive", "cargo", "wrap_help", "yaml", "env", "unicode", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"] # for docs.rs
unstable-doc = ["derive", "cargo", "wrap_help", "yaml", "env", "unicode", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"] # for docs.rs

# Used in default
std = ["indexmap/std"] # support for no_std in a backwards-compatible way
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ _FEATURES = minimal default wasm full debug release
_FEATURES_minimal = --no-default-features --features "std"
_FEATURES_default =
_FEATURES_wasm = --features "derive cargo env unicode yaml regex unstable-replace unstable-multicall unstable-grouped"
_FEATURES_full = --features "derive cargo env unicode yaml regex unstable-replace unstable-multicall unstable-grouped wrap_help doc"
_FEATURES_full = --features "derive cargo env unicode yaml regex unstable-replace unstable-multicall unstable-grouped wrap_help unstable-doc"
_FEATURES_debug = ${_FEATURES_full} --features debug
_FEATURES_release = ${_FEATURES_full} --release

_FEATURES_all = --all-features

check-%:
cargo check ${_FEATURES_${@:check-%=%}} --all-targets ${ARGS}

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
// notice may not be copied, modified, or distributed except according to those terms.

#![cfg_attr(feature = "docsrs", feature(doc_auto_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")]
#![cfg_attr(feature = "doc", doc = include_str!("../README.md"))]
#![cfg_attr(feature = "derive", doc = include_str!("../README.md"))]
//! <https://github.com/clap-rs/clap>
#![warn(
missing_docs,
Expand Down
4 changes: 2 additions & 2 deletions tests/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ fn example_tests() {
let features = [
#[cfg(feature = "debug")]
"debug",
#[cfg(feature = "doc")]
"doc",
#[cfg(feature = "unstable-doc")]
"unstable-doc",
#[cfg(feature = "std")]
"std",
#[cfg(feature = "derive")]
Expand Down

0 comments on commit 3b5c5c7

Please sign in to comment.