From 66b0fd2918ab7f5263c0362647d095a16c3ed7b5 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 9 Nov 2022 12:24:33 -0600 Subject: [PATCH 1/2] refactor(gh): Follow standard template --- .github/dependabot.yml | 10 +- .github/settings.yml | 30 +++++ .github/workflows/audit.yml | 31 +++++ .github/workflows/ci.yml | 212 +++++++++++++++++-------------- .github/workflows/committed.yml | 24 ++++ .github/workflows/docs.yml | 40 ------ .github/workflows/pre-commit.yml | 23 ++++ .github/workflows/spelling.yml | 21 +++ .gitignore | 5 +- .pre-commit-config.yaml | 26 ++++ CHANGELOG.md | 33 ++++- CONTRIBUTING.md | 68 ++++++++++ Cargo.lock | 135 ++++++++++++++++++++ Cargo.toml | 41 ++++-- committed.toml | 3 + release.toml | 2 + rust-toolchain | 1 - 17 files changed, 547 insertions(+), 158 deletions(-) create mode 100644 .github/settings.yml create mode 100644 .github/workflows/audit.yml create mode 100644 .github/workflows/committed.yml delete mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .github/workflows/spelling.yml create mode 100644 .pre-commit-config.yaml create mode 100644 CONTRIBUTING.md create mode 100644 Cargo.lock create mode 100644 committed.toml create mode 100644 release.toml delete mode 100644 rust-toolchain diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5cde1657..780b4c4f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,5 +3,13 @@ updates: - package-ecosystem: cargo directory: "/" schedule: - interval: daily + interval: monthly + time: "07:00" + open-pull-requests-limit: 10 + +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: monthly + time: "07:00" open-pull-requests-limit: 10 diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 00000000..390d5e5e --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,30 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ + +repository: + description: A logging implementation for `log` which is configured via an environment variable. + homepage: https://docs.rs/env_logger + topics: rust logging + has_issues: true + has_projects: false + has_wiki: false + has_downloads: false + default_branch: main + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + + # Manual: allow_auto_merge: true, see https://github.com/probot/settings/issues/402 + delete_branch_on_merge: true + +branches: + - name: main + protection: + required_pull_request_reviews: null + required_conversation_resolution: true + required_status_checks: + # Required. Require branches to be up to date before merging. + strict: false + contexts: ["CI", "Lint Commits", "Spell Check with Typos"] + enforce_admins: false + restrictions: null diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 00000000..30c74744 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,31 @@ +name: Security audit + +permissions: + contents: read + +on: + pull_request: + paths: + - '**/Cargo.toml' + - '**/Cargo.lock' + push: + branches: + - main + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + security_audit: + permissions: + issues: write # to create issues (actions-rs/audit-check) + checks: write # to create check (actions-rs/audit-check) + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2e8979f..26ba913b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,114 +1,130 @@ -name: Continuous Integration +name: CI + +permissions: + contents: read on: pull_request: - paths: - - "**.rs" - - "Cargo.toml" - - "Cargo.lock" + push: + branches: + - main + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 jobs: - fmt: - name: Source formatting check + ci: + permissions: + contents: none + name: CI + needs: [test, msrv, docs, rustfmt, clippy] runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - components: rustfmt - - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - check: - name: Compilation check - runs-on: ubuntu-latest + - name: Done + run: exit 0 + test: + name: Test strategy: - fail-fast: true matrix: - rust: - - stable - - beta - - nightly - - 1.41.0 + os: ["ubuntu-latest", "windows-latest", "macos-latest"] + rust: ["stable"] + continue-on-error: ${{ matrix.rust != 'stable' }} + runs-on: ${{ matrix.os }} steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - - clippy: - name: Lint check + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: Build + run: cargo test --no-run --workspace --all-features + - name: Default features + run: cargo test --workspace + - name: All features + run: cargo test --workspace --all-features + - name: No-default features + run: cargo test --workspace --no-default-features + - name: Check feature combinations + run: cargo run -p ci + - name: Run crate example + run: cargo run --example default + msrv: + name: "Check MSRV: 1.41.0" runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - - name: Run lints - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - - ci-crate: - name: CI crate check + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.41.0 # MSRV + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: Default features + run: cargo check --workspace --all-targets + - name: All features + run: cargo check --workspace --all-targets --all-features + - name: No-default features + run: cargo check --workspace --all-targets --no-default-features + docs: + name: Docs runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Run ci crate - uses: actions-rs/cargo@v1 - with: - command: run - args: -p ci - - crate-example: - name: Crate example check + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - uses: Swatinem/rust-cache@v1 + - name: Check documentation + env: + RUSTDOCFLAGS: -D warnings + run: cargo doc --workspace --all-features --no-deps --document-private-items + rustfmt: + name: rustfmt runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Run crate example - uses: actions-rs/cargo@v1 - with: - command: run - args: --example default + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + # Not MSRV because its harder to jump between versions and people are + # more likely to have stable + toolchain: stable + profile: minimal + override: true + components: rustfmt + - uses: Swatinem/rust-cache@v1 + - name: Check formatting + run: cargo fmt --all -- --check + clippy: + name: clippy + runs-on: ubuntu-latest + permissions: + checks: write # to create check (actions-rs/audit-check) + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.41.0 # MSRV + profile: minimal + override: true + components: clippy + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --workspace --all-features --all-targets -- -D warnings --allow deprecated diff --git a/.github/workflows/committed.yml b/.github/workflows/committed.yml new file mode 100644 index 00000000..509be080 --- /dev/null +++ b/.github/workflows/committed.yml @@ -0,0 +1,24 @@ +# Not run as part of pre-commit checks because they don't handle sending the correct commit +# range to `committed` +name: Lint Commits +on: [pull_request] + +permissions: + contents: read + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + committed: + name: Lint Commits + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Lint Commits + uses: crate-ci/committed@master diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index a135b860..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Continuous Integration - Docs - -on: - push: - branches: - - main - paths: - - "**.rs" - - "Cargo.toml" - - "Cargo.lock" - workflow_dispatch: - -jobs: - docs: - name: Generate crate documentation - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - - name: Generate documentation - uses: actions-rs/cargo@v1 - env: - RUSTDOCFLAGS: "--enable-index-page -Zunstable-options" - with: - command: doc - args: --no-deps - - - name: Deploy documentation - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..21c188d8 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,23 @@ +name: pre-commit + +permissions: {} # none + +on: + pull_request: + push: + branches: [main] + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + pre-commit: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 00000000..f31c7ed8 --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,21 @@ +name: Spelling + +permissions: + contents: read + +on: [pull_request] + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + +jobs: + spelling: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Spell Check Repo + uses: crate-ci/typos@master diff --git a/.gitignore b/.gitignore index a01f99de..eb5a316c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -target/ -Cargo.lock -.emacs* -*~ +target diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..f751dec5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-yaml + stages: [commit] + - id: check-json + stages: [commit] + - id: check-toml + stages: [commit] + - id: check-merge-conflict + stages: [commit] + - id: check-case-conflict + stages: [commit] + - id: detect-private-key + stages: [commit] + - repo: https://github.com/crate-ci/typos + rev: v1.11.1 + hooks: + - id: typos + stages: [commit] + - repo: https://github.com/crate-ci/committed + rev: v1.0.4 + hooks: + - id: committed + stages: [commit-msg] diff --git a/CHANGELOG.md b/CHANGELOG.md index 266e24a7..25429888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ -Changes to this crate are tracked via [GitHub Releases][releases]. +# Change Log +All notable changes to this project will be documented in this file. -[releases]: https://github.com/env-logger-rs/env_logger/releases +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [Unreleased] - ReleaseDate + +## [0.9.3] - 2022-11-07 + +- Fix a regression from v0.9.2 where env_logger would fail to compile with the termcolor feature turned off. + +## [0.9.2] - 2022-11-07 + +- Fix and un-deprecate Target::Pipe, which was basically not working at all before and deprecated in 0.9.1. + +## [0.9.0] -- 2022-07-14 + +### Breaking Changes + +- Default message format now prints the target instead of the module + +### Improvements + +- Added a method to print the module instead of the target + + +[Unreleased]: https://github.com/rust-cli/argfile/compare/v0.9.3...HEAD +[0.9.3]: https://github.com/rust-cli/argfile/compare/v0.9.2...v0.9.3 +[0.9.2]: https://github.com/rust-cli/argfile/compare/v0.9.0...v0.9.2 +[0.9.0]: https://github.com/rust-cli/argfile/compare/v0.8.4...v0.9.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..aba52341 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,68 @@ +# Contributing to env_logger + +Thanks for wanting to contribute! There are many ways to contribute and we +appreciate any level you're willing to do. + +## Feature Requests + +Need some new functionality to help? You can let us know by opening an +[issue][new issue]. It's helpful to look through [all issues][all issues] in +case its already being talked about. + +## Bug Reports + +Please let us know about what problems you run into, whether in behavior or +ergonomics of API. You can do this by opening an [issue][new issue]. It's +helpful to look through [all issues][all issues] in case its already being +talked about. + +## Pull Requests + +Looking for an idea? Check our [issues][issues]. If it's look more open ended, +it is probably best to post on the issue how you are thinking of resolving the +issue so you can get feedback early in the process. We want you to be +successful and it can be discouraging to find out a lot of re-work is needed. + +Already have an idea? It might be good to first [create an issue][new issue] +to propose it so we can make sure we are aligned and lower the risk of having +to re-work some of it and the discouragement that goes along with that. + +### Process + +When you first post a PR, we request that the the commit history get cleaned +up. We recommend avoiding this during the PR to make it easier to review how +feedback was handled. Once the commit is ready, we'll ask you to clean up the +commit history. Once you let us know this is done, we can move forward with +merging! If you are uncomfortable with these parts of git, let us know and we +can help. + +For commit messages, we use [Conventional](https://www.conventionalcommits.org) +style. If you already wrote your commits and don't feel comfortable changing +them, don't worry and go ahead and create your PR. We'll work with you on the +best route forward. You can check your branch locally with +[`committed`](https://github.com/crate-ci/committed). + +As a heads up, we'll be running your PR through the following gauntlet: +- warnings turned to compile errors +- `cargo test` +- `rustfmt` +- `clippy` +- `rustdoc` +- [`committed`](https://github.com/crate-ci/committed) + +## Releasing + +Pre-requisites +- Running `cargo login` +- A member of `rust-cli:Maintainers` +- Push permission to the repo + +When we're ready to release, a project owner should do the following +1. Update the changelog +2. Determine what the next version is, according to semver +3. Run [`cargo release -x `](https://github.com/crate-ci/cargo-release) + +[issues]: https://github.com/rust-cli/env_logger/issues +[new issue]: https://github.com/rust-cli/env_logger/issues/new +[all issues]: https://github.com/rust-cli/env_logger/issues?utf8=%E2%9C%93&q=is%3Aissue +[travis]: https://github.com/rust-cli/env_logger/blob/master/.travis.yml diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..337e0554 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,135 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ci" +version = "0.0.0" + +[[package]] +name = "env_logger" +version = "0.9.3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index d44b8cd8..961c6146 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,44 @@ +[workspace] +members = [ + "ci" +] + [package] name = "env_logger" -edition = "2018" version = "0.9.3" -license = "MIT OR Apache-2.0" -readme = "README.md" -repository = "https://github.com/env-logger-rs/env_logger/" -documentation = "https://docs.rs/env_logger" description = """ A logging implementation for `log` which is configured via an environment variable. """ +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-cli/env_logger/" categories = ["development-tools::debugging"] keywords = ["logging", "log", "logger"] -include = ["src/**/*", "tests", "LICENSE-*", "README.md", "CHANGELOG.md"] +edition = "2018" +rust-version = "1.41.0" # MSRV +include = [ + "build.rs", + "src/**/*", + "Cargo.toml", + "LICENSE*", + "README.md", + "tests/**/*", + "benches/**/*", + "examples/**/*" +] -[workspace] -members = [ - "ci" +[package.metadata.release] +pre-release-replacements = [ + {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, + {file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1}, + {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, + {file="CHANGELOG.md", search="", replace="\n## [Unreleased] - ReleaseDate\n", exactly=1}, + {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/env_logger/compare/{{tag_name}}...HEAD", exactly=1}, ] +[features] +default = ["termcolor", "atty", "humantime", "regex"] + [dependencies] log = { version = "0.4.8", features = ["std"] } regex = { version = "1.0.3", optional = true, default-features=false, features=["std", "perf"] } @@ -41,6 +61,3 @@ harness = false [[test]] name = "init-twice-retains-filter" harness = false - -[features] -default = ["termcolor", "atty", "humantime", "regex"] diff --git a/committed.toml b/committed.toml new file mode 100644 index 00000000..08815cf9 --- /dev/null +++ b/committed.toml @@ -0,0 +1,3 @@ +style="conventional" +ignore_author_re="dependabot" +merge_commit = false diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..a5de1c15 --- /dev/null +++ b/release.toml @@ -0,0 +1,2 @@ +owners = ["rust-cli:Maintainers"] +allow-branch = ["main"] diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 033080c4..00000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.41.0 From f1ff331fa2e3f1111cd918ba91b22ad5a7070777 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 9 Nov 2022 12:38:54 -0600 Subject: [PATCH 2/2] docs: Fix typos --- src/filter/mod.rs | 6 +++--- src/fmt/writer/termcolor/extern_impl.rs | 2 +- src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/filter/mod.rs b/src/filter/mod.rs index a02d6bc1..721dcb46 100644 --- a/src/filter/mod.rs +++ b/src/filter/mod.rs @@ -762,7 +762,7 @@ mod tests { #[test] fn parse_spec_blank_level_isolated_comma_only() { // The spec should contain zero or more comma-separated string slices, - // so a comma-only string should be interpretted as two empty strings + // so a comma-only string should be interpreted as two empty strings // (which should both be treated as invalid, so ignored). let (dirs, filter) = parse_spec(","); // should be ignored assert_eq!(dirs.len(), 0); @@ -772,7 +772,7 @@ mod tests { #[test] fn parse_spec_blank_level_isolated_comma_blank() { // The spec should contain zero or more comma-separated string slices, - // so this bogus spec should be interpretted as containing one empty + // so this bogus spec should be interpreted as containing one empty // string and one blank string. Both should both be treated as // invalid, so ignored. let (dirs, filter) = parse_spec(", "); // should be ignored @@ -783,7 +783,7 @@ mod tests { #[test] fn parse_spec_blank_level_isolated_blank_comma() { // The spec should contain zero or more comma-separated string slices, - // so this bogus spec should be interpretted as containing one blank + // so this bogus spec should be interpreted as containing one blank // string and one empty string. Both should both be treated as // invalid, so ignored. let (dirs, filter) = parse_spec(" ,"); // should be ignored diff --git a/src/fmt/writer/termcolor/extern_impl.rs b/src/fmt/writer/termcolor/extern_impl.rs index fbe37a77..89c38223 100644 --- a/src/fmt/writer/termcolor/extern_impl.rs +++ b/src/fmt/writer/termcolor/extern_impl.rs @@ -107,7 +107,7 @@ impl BufferWriter { pipe: Box>, ) -> Self { BufferWriter { - // The inner Buffer is never printed from, but it is still needed to handle coloring and other formating + // The inner Buffer is never printed from, but it is still needed to handle coloring and other formatting inner: termcolor::BufferWriter::stderr(write_style.into_color_choice()), uncolored_target: Some(WritableTarget::Pipe(pipe)), } diff --git a/src/lib.rs b/src/lib.rs index 642b731a..c0ee8bd9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,7 +97,7 @@ //! ``` //! //! The log target is typically equal to the path of the module the message -//! in question originated from, though it can be overriden. +//! in question originated from, though it can be overridden. //! //! The path is rooted in the name of the crate it was compiled for, so if //! your program is in a file called, for example, `hello.rs`, the path would @@ -907,7 +907,7 @@ impl Log for Logger { fn log(&self, record: &Record) { if self.matches(record) { // Log records are written to a thread-local buffer before being printed - // to the terminal. We clear these buffers afterwards, but they aren't shrinked + // to the terminal. We clear these buffers afterwards, but they aren't shrunk // so will always at least have capacity for the largest log record formatted // on that thread. //