Skip to content

Commit

Permalink
make GitHub actions stop on first error for Windows, too; fix failing…
Browse files Browse the repository at this point in the history
… documentation tests
  • Loading branch information
apparebit committed Jan 20, 2025
1 parent d090a7a commit 6075153
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions crates/prettypretty/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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(())
//! # }
//! ```
Expand All @@ -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) {
Expand All @@ -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(())
//! # }
//! ```
Expand All @@ -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) {
Expand All @@ -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(())
//! # }
//! ```
Expand Down

0 comments on commit 6075153

Please sign in to comment.