diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e914670..3bbf415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,19 +73,23 @@ jobs: run: cargo install mdbook - name: Check Rust code (with & without features) + shell: bash run: | cargo check --workspace cargo check --workspace --all-features - name: Run Clippy (with & without features) + shell: bash run: | cargo clippy --workspace cargo clippy --workspace --all-features - name: Check Rust format + shell: bash run: cargo fmt --all --check - name: Test Rust code + shell: bash env: RUST_BACKTRACE: 1 run: | @@ -96,6 +100,7 @@ jobs: run: pip install -e .[dev] - name: Typecheck and test Python code + shell: bash run: python -m runtest - name: Test guide's Rust examples diff --git a/crates/prettypretty/src/lib.rs b/crates/prettypretty/src/lib.rs index 5aae17d..3cdecf6 100644 --- a/crates/prettypretty/src/lib.rs +++ b/crates/prettypretty/src/lib.rs @@ -121,6 +121,8 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! # use prettytty::Connection; //! # use prettytty::opt::Options; //! # fn main() -> Result<()> { +//! # #[cfg(not(target_family = "windows"))] +//! # { //! # let chic = stylist().bold().underlined().rgb(215, 40, 39).fg().et_voila(); //! // 2a. Determine terminal's color support and theme //! let options = Options::builder().timeout(50).build(); @@ -129,6 +131,7 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! Err(_) => (false, VGA_COLORS), //! }; //! let fidelity = Fidelity::from_environment(has_tty); +//! # } //! # Ok(()) //! # } //! ``` @@ -147,6 +150,8 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! # use prettytty::Connection; //! # use prettytty::opt::Options; //! # fn main() -> Result<()> { +//! # #[cfg(not(target_family = "windows"))] +//! # { //! # let chic = stylist().bold().underlined().rgb(215, 40, 39).fg().et_voila(); //! # let options = Options::builder().timeout(50).build(); //! # let (has_tty, theme) = match Connection::with_options(options) { @@ -157,6 +162,7 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! // 2b. Actually adjust styles //! let translator = Translator::new(OkVersion::Revised, theme); //! let effective_chic = &chic.cap(fidelity, &translator); +//! # } //! # Ok(()) //! # } //! ``` @@ -174,6 +180,8 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! # use prettytty::Connection; //! # use prettytty::opt::Options; //! # fn main() -> Result<()> { +//! # #[cfg(not(target_family = "windows"))] +//! # { //! # let chic = stylist().bold().underlined().rgb(215, 40, 39).fg().et_voila(); //! # let options = Options::builder().timeout(50).build(); //! # let (has_tty, theme) = match Connection::with_options(options) { @@ -185,6 +193,7 @@ feature disabled, [on Docs.rs](https://docs.rs/prettypretty/latest/prettypretty/ //! # let effective_chic = &chic.cap(fidelity, &translator); //! // 3. Apply and revert styles //! println!("{}Wow!{}", effective_chic, -effective_chic); +//! # } //! # Ok(()) //! # } //! ```