diff --git a/.clippy.toml b/.clippy.toml index e88edc91..1d4c5dc6 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1,5 +1,4 @@ -msrv = "1.70.0" # MSRV -warn-on-all-wildcard-imports = true +allow-print-in-tests = true allow-expect-in-tests = true allow-unwrap-in-tests = true allow-dbg-in-tests = true diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 89171245..c1844208 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,6 +3,7 @@ 'before 5am on the first day of the month', ], semanticCommits: 'enabled', + commitMessageLowerCase: 'never', configMigration: true, dependencyDashboard: true, customManagers: [ @@ -17,29 +18,28 @@ '^\\.github/workflows/rust-next.yml$', ], matchStrings: [ - 'MSRV.*?(?\\d+\\.\\d+(\\.\\d+)?)', - '(?\\d+\\.\\d+(\\.\\d+)?).*?MSRV', + 'STABLE.*?(?\\d+\\.\\d+(\\.\\d+)?)', + '(?\\d+\\.\\d+(\\.\\d+)?).*?STABLE', ], - depNameTemplate: 'rust', + depNameTemplate: 'STABLE', packageNameTemplate: 'rust-lang/rust', datasourceTemplate: 'github-releases', }, ], packageRules: [ { - commitMessageTopic: 'MSRV', + commitMessageTopic: 'Rust Stable', matchManagers: [ - 'regex', + 'custom.regex', ], matchPackageNames: [ - 'rust', + 'STABLE', ], - minimumReleaseAge: '252 days', // 6 releases * 6 weeks per release * 7 days per week - internalChecksFilter: 'strict', extractVersion: '^(?\\d+\\.\\d+)', // Drop the patch version schedule: [ '* * * * *', ], + automerge: true, }, // Goals: // - Keep version reqs low, ignoring compatible normal/build dependencies @@ -72,6 +72,7 @@ matchCurrentVersion: '>=1.0.0', matchUpdateTypes: [ 'minor', + 'patch', ], enabled: false, }, @@ -99,6 +100,7 @@ matchCurrentVersion: '>=1.0.0', matchUpdateTypes: [ 'minor', + 'patch', ], automerge: true, groupName: 'compatible (dev)', diff --git a/.github/settings.yml b/.github/settings.yml index bcdc959a..d126ed82 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -25,31 +25,45 @@ repository: merge_commit_message: "PR_BODY" labels: + - name: "A-style" + description: "Area: anstyle" + color: '#f7e101' + - name: "A-stream" + description: "Area: anstream" + color: '#f7e101' # Type - - name: bug - color: '#b60205' - description: "Not as expected" - - name: enhancement - color: '#1d76db' - description: "Improve the expected" - # Flavor - - name: question - color: "#cc317c" - description: "Uncertainty is involved" - - name: breaking-change - color: "#e99695" - - name: good first issue - color: '#c2e0c6' + - name: "C-bug" + color: '#f5f1fd' + description: "Category: Things not working as expected" + - name: "C-enhancement" + color: '#f5f1fd' + description: "Category: Raise on the bar on expectations" + # Status + - name: "S-triage" + description: "Status: New; needs maintainer attention." + color: '#D3DDDD' + - name: "S-blocked" + description: "Status: Blocked on something else such as an RFC or other implementation work." + color: '#D3DDDD' + # Meta + - name: "breaking-change" + color: '#E10C02' + - name: "E-help-wanted" + color: '#02E10C' description: "Help wanted!" -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 +# This serves more as documentation. +# Branch protection API was replaced by rulesets but settings isn't updated. +# See https://github.com/repository-settings/app/issues/825 +# +# 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", "Spell Check with Typos"] +# enforce_admins: false +# restrictions: null diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 5b7e83ac..a94be159 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -17,6 +17,10 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: security_audit: permissions: @@ -27,7 +31,7 @@ jobs: continue-on-error: true steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -42,8 +46,8 @@ jobs: checks: - bans licenses sources steps: - - uses: actions/checkout@v3 - - uses: EmbarkStudios/cargo-deny-action@v1 + - uses: actions/checkout@v4 + - uses: EmbarkStudios/cargo-deny-action@v2 with: command: check ${{ matrix.checks }} rust-version: stable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28f8baac..c3750839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,16 +14,22 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: ci: permissions: contents: none name: CI - needs: [test, msrv, docs, rustfmt, clippy] + needs: [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions] runs-on: ubuntu-latest + if: "always()" steps: - - name: Done - run: exit 0 + - name: Failed + run: exit 1 + if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')" test: name: Test strategy: @@ -34,61 +40,72 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} + components: rustfmt - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@cargo-hack - 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 + run: cargo test --workspace --no-run + - name: Test + run: cargo hack test --feature-powerset --workspace msrv: - name: "Check MSRV: 1.70.0" + name: "Check MSRV" runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.70.0 # MSRV + toolchain: stable - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@cargo-hack - 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 - - name: no_std - run: cargo check -p anstyle --no-default-features + run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace + minimal-versions: + name: Minimal versions + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install stable Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Install nightly Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + - name: Downgrade dependencies to minimal versions + run: cargo +nightly generate-lockfile -Z minimal-versions + - name: Compile with minimal versions + run: cargo +stable check --workspace --all-features --locked lockfile: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable - uses: Swatinem/rust-cache@v2 - name: "Is lockfile updated?" - run: cargo fetch --locked + run: cargo update --workspace --locked docs: name: Docs runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: stable + toolchain: "1.82.0" # STABLE - uses: Swatinem/rust-cache@v2 - name: Check documentation env: @@ -99,13 +116,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - # Not MSRV because its harder to jump between versions and people are - # more likely to have stable - toolchain: stable + toolchain: "1.82.0" # STABLE components: rustfmt - uses: Swatinem/rust-cache@v2 - name: Check formatting @@ -117,17 +132,17 @@ jobs: security-events: write # to upload sarif results steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.70.0 # MSRV + toolchain: "1.82.0" # STABLE components: clippy - uses: Swatinem/rust-cache@v2 - name: Install SARIF tools - run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv + run: cargo install clippy-sarif --locked - name: Install SARIF tools - run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv + run: cargo install sarif-fmt --locked - name: Check run: > cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated @@ -136,9 +151,28 @@ jobs: | sarif-fmt continue-on-error: true - name: Upload - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: clippy-results.sarif wait-for-processing: true - name: Report status run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - uses: Swatinem/rust-cache@v2 + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin + - name: Gather coverage + run: cargo tarpaulin --output-dir coverage --out lcov + - name: Publish to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/committed.yml b/.github/workflows/committed.yml index 509be080..e7a50fbb 100644 --- a/.github/workflows/committed.yml +++ b/.github/workflows/committed.yml @@ -11,13 +11,17 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: committed: name: Lint Commits runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Lint Commits diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index d4b0f84a..7b55a3d9 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -12,12 +12,18 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: pre-commit: permissions: contents: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/rust-next.yml b/.github/workflows/rust-next.yml index a540ba58..0cfa1800 100644 --- a/.github/workflows/rust-next.yml +++ b/.github/workflows/rust-next.yml @@ -12,6 +12,10 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: test: name: Test @@ -26,34 +30,34 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.rust }} + components: rustfmt - uses: Swatinem/rust-cache@v2 - - 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 + - uses: taiki-e/install-action@cargo-hack + - name: Build + run: cargo test --workspace --no-run + - name: Test + run: cargo hack test --feature-powerset --workspace latest: name: "Check latest dependencies" runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: toolchain: stable + components: rustfmt - uses: Swatinem/rust-cache@v2 - - name: Update dependencues + - uses: taiki-e/install-action@cargo-hack + - name: Update dependencies run: cargo update - - name: Default features - run: cargo test --workspace --all-targets - - name: All features - run: cargo test --workspace --all-targets --all-features - - name: No-default features - run: cargo test --workspace --all-targets --no-default-features + - name: Build + run: cargo test --workspace --no-run + - name: Test + run: cargo hack test --feature-powerset --workspace diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index f31c7ed8..8e58d9ec 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -10,12 +10,16 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + jobs: spelling: name: Spell Check with Typos runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Spell Check Repo uses: crate-ci/typos@master diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d9e40fd..68db968e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml stages: [commit] @@ -15,7 +15,7 @@ repos: - id: detect-private-key stages: [commit] - repo: https://github.com/crate-ci/typos - rev: v1.16.3 + rev: v1.16.20 hooks: - id: typos stages: [commit] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 432e738d..900f3c39 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,27 +29,42 @@ 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) -- [`typos`](https://github.com/crate-ci/typos) +- [`committed`](https://github.com/crate-ci/committed) as we use [Conventional](https://www.conventionalcommits.org) commit style +- [`typos`](https://github.com/crate-ci/typos) to check spelling + +Not everything can be checked automatically though. + +We request that the commit history gets cleaned up. +We ask that commits are atomic, meaning they are complete and have a single responsibility. +PRs should tell a cohesive story, with test and refactor commits that keep the +fix or feature commits simple and clear. + +Specifically, we would encourage +- File renames be isolated into their own commit +- Add tests in a commit before their feature or fix, showing the current behavior. + The diff for the feature/fix commit will then show how the behavior changed, + making it clearer to reviewrs and the community and showing people that the + test is verifying the expected state. + - e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520) + +Note that we are talking about ideals. +We understand having a clean history requires more advanced git skills; +feel free to ask us for help! +We might even suggest where it would work to be lax. +We also understand that editing some early commits may cause a lot of churn +with merge conflicts which can make it not worth editing all of the history. + +For code organization, we recommend +- Grouping `impl` blocks next to their type (or trait) +- Grouping private items after the `pub` item that uses them. + - The intent is to help people quickly find the "relevant" details, allowing them to "dig deeper" as needed. Or put another way, the `pub` items serve as a table-of-contents. + - The exact order is fuzzy; do what makes sense ## Releasing diff --git a/Cargo.lock b/Cargo.lock index 3bb7244c..1995ca57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "ansi_term" version = "0.12.1" @@ -19,28 +13,46 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ - "anstyle 1.0.0", - "anstyle-parse 0.2.0", - "anstyle-query 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "anstyle-wincon 2.1.0", - "colorchoice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-parse 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-query 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-wincon 1.0.2", + "colorchoice 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "is-terminal", "utf8parse", ] [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ - "anstyle 1.0.4", - "anstyle-parse 0.2.2", - "anstyle-query 1.0.0", - "anstyle-wincon 3.0.1", - "colorchoice 1.0.0", - "criterion", + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-parse 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-query 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "anstyle-wincon 3.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "colorchoice 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstream" +version = "0.6.18" +dependencies = [ + "anstyle 1.0.10", + "anstyle-parse 0.2.6", + "anstyle-query 1.1.2", + "anstyle-wincon 3.0.6", + "colorchoice 1.0.3", + "divan", + "is_terminal_polyfill", + "lexopt", "owo-colors", "proptest", "strip-ansi-escapes", @@ -49,165 +61,188 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" - -[[package]] -name = "anstyle" -version = "1.0.4" +version = "1.0.10" dependencies = [ "lexopt", ] +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + [[package]] name = "anstyle-ansi-term" -version = "1.0.0" +version = "1.0.3" dependencies = [ "ansi_term", - "anstyle 1.0.4", + "anstyle 1.0.10", ] [[package]] name = "anstyle-crossterm" -version = "2.0.0" +version = "3.0.1" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "crossterm", ] [[package]] name = "anstyle-git" -version = "1.0.0" +version = "1.1.2" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", ] [[package]] name = "anstyle-lossy" -version = "1.0.0" +version = "1.1.3" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", ] [[package]] name = "anstyle-ls" -version = "1.0.1" +version = "1.0.4" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", ] [[package]] name = "anstyle-owo-colors" -version = "1.0.1" +version = "2.0.3" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "owo-colors", ] [[package]] name = "anstyle-parse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +version = "0.2.6" dependencies = [ + "arrayvec", + "codegenrs", + "divan", + "proptest", + "snapbox", "utf8parse", + "vte_generate_state_changes", ] [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ - "arrayvec", - "codegenrs", - "criterion", - "proptest", - "snapbox", "utf8parse", - "vte_generate_state_changes", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.2" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-roff" -version = "0.3.2" +version = "0.3.5" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "anstyle-lossy", "cansi", "roff", "snapbox", ] +[[package]] +name = "anstyle-svg" +version = "0.1.7" +dependencies = [ + "anstream 0.6.18", + "anstyle 1.0.10", + "anstyle-lossy", + "html-escape", + "snapbox", + "unicode-width", +] + [[package]] name = "anstyle-syntect" -version = "1.0.0" +version = "1.0.3" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "syntect", + "thiserror", ] [[package]] name = "anstyle-termcolor" -version = "1.1.0" +version = "1.1.3" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "termcolor", ] [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ - "anstyle 1.0.0", + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "windows-sys 0.48.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.6" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "lexopt", - "windows-sys 0.48.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +dependencies = [ + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-yansi" -version = "1.0.0" +version = "2.0.2" dependencies = [ - "anstyle 1.0.4", + "anstyle 1.0.10", "yansi", ] [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bit-set" @@ -232,21 +267,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "bumpalo" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cansi" @@ -254,83 +283,46 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bdcae87153686017415ce77e48c53e6818a0a058f0e21b56640d1e944967ef8" -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "ciborium" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "ciborium-ll" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clap" -version = "4.4.2" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" dependencies = [ "clap_builder", "clap_derive", + "once_cell", ] [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" dependencies = [ - "anstream 0.5.0", - "anstyle 1.0.0", + "anstream 0.3.2", + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "clap_lex", "strsim", + "terminal_size", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.15", + "syn", ] [[package]] @@ -341,139 +333,50 @@ checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codegenrs" -version = "2.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ecb55fae620b95dc3586f10bf6d93d4bfc73b34b0adddf18445b9291458dd6" +checksum = "11a564a9c6e001f881ff5074dc1fb10aae609c82c92b7ddb47e40987be820771" dependencies = [ - "derive_more", "difference", "normalize-line-endings", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colorchoice-clap" -version = "1.0.3" +version = "1.0.6" dependencies = [ - "anstream 0.6.4", + "anstream 0.6.18", "clap", - "colorchoice 1.0.0", + "colorchoice 1.0.3", "owo-colors", ] [[package]] -name = "content_inspector" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" -dependencies = [ - "memchr", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" +name = "condtype" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "crossterm_winapi", - "libc", "parking_lot", + "rustix 0.38.38", "winapi", ] @@ -486,19 +389,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.102", -] - [[package]] name = "difference" version = "2.0.0" @@ -506,69 +396,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" [[package]] -name = "dunce" -version = "1.0.3" +name = "divan" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6e05d17bd4ff1c1e7998ed4623d2efd91f72f1e24141ac33aac9377974270e1f" dependencies = [ - "errno-dragonfly", + "cfg-if", + "clap", + "condtype", + "divan-macros", "libc", - "winapi", + "regex-lite", ] [[package]] -name = "errno" -version = "0.3.3" +name = "divan-macros" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "1b4464d46ce68bfc7cb76389248c7c254def7baca8bece0693b02b83842c4c88" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "1.9.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "filetime" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.45.0", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fnv" @@ -578,21 +444,15 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - [[package]] name = "heck" version = "0.4.1" @@ -601,78 +461,67 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] -name = "instant" -version = "0.1.12" +name = "html-escape" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" dependencies = [ - "cfg-if", + "utf8-width", ] [[package]] name = "io-lifetimes" -version = "1.0.5" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi 0.3.9", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.1", - "rustix 0.38.11", - "windows-sys 0.48.0", + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", ] [[package]] -name = "itertools" -version = "0.10.5" +name = "is_terminal_polyfill" +version = "1.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "2736dd548daf35f50d261bbad35a83890bb9b461797f15de528485fbf206ab15" dependencies = [ - "either", + "is-terminal", ] [[package]] name = "itoa" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - -[[package]] -name = "js-sys" -version = "0.3.61" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" -dependencies = [ - "wasm-bindgen", -] +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lexopt" @@ -682,61 +531,43 @@ checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", ] -[[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" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "normalize-line-endings" @@ -746,47 +577,31 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", ] -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - [[package]] name = "once_cell" -version = "1.15.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -794,69 +609,44 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.36.1", + "windows-targets 0.52.6", ] [[package]] -name = "plotters" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" - -[[package]] -name = "plotters-svg" -version = "0.3.3" +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "plotters-backend", + "zerocopy", ] -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.2.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", - "bitflags 1.3.2", - "byteorder", + "bit-vec", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", @@ -876,9 +666,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.27" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -922,51 +712,26 @@ dependencies = [ "rand_core", ] -[[package]] -name = "rayon" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] -name = "regex" -version = "1.7.1" +name = "regex-lite" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "regex-syntax", -] +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "roff" @@ -974,40 +739,31 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustix" -version = "0.36.8" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", + "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.38.11" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ - "bitflags 2.4.0", - "errno 0.3.3", + "bitflags 2.6.0", + "errno", "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", ] [[package]] @@ -1024,9 +780,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -1039,84 +795,74 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "1.0.16" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.145" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 1.0.102", + "syn", ] [[package]] name = "serde_json" -version = "1.0.86" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "similar" -version = "2.2.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "smallvec" -version = "1.9.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snapbox" -version = "0.4.12" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad90eb3a2e3a8031d636d45bd4832751aefd58a291b553f7305a2bacae21aff3" +checksum = "881f1849454828a68363dd288b7a0a071e55e2a4356d2c38b567db18a9be0d9f" dependencies = [ - "anstream 0.5.0", - "anstyle 1.0.0", - "content_inspector", - "dunce", - "filetime", + "anstream 0.6.17", + "anstyle 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "normalize-line-endings", "similar", "snapbox-macros", - "tempfile", - "walkdir", ] [[package]] name = "snapbox-macros" -version = "0.3.5" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f4ffd811b87da98d0e48285134b7847954bd76e843bb794a893b47ca3ee325" +checksum = "16569f53ca23a41bb6f62e0a5084aa1661f4814a67fa33696a79073e03a664af" dependencies = [ - "anstream 0.5.0", + "anstream 0.6.17", ] [[package]] @@ -1136,20 +882,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.102" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ "proc-macro2", "quote", @@ -1158,12 +893,11 @@ dependencies = [ [[package]] name = "syntect" -version = "5.0.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bitflags 1.3.2", - "lazy_static", "once_cell", "serde", "serde_derive", @@ -1174,54 +908,54 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.4.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", - "rustix 0.36.8", - "windows-sys 0.42.0", + "once_cell", + "rustix 0.38.38", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] -name = "thiserror" -version = "1.0.37" +name = "terminal_size" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "thiserror-impl", + "rustix 0.37.27", + "windows-sys 0.48.0", ] [[package]] -name = "thiserror-impl" -version = "1.0.37" +name = "thiserror" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", + "thiserror-impl", ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "thiserror-impl" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ - "serde", - "serde_json", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1232,15 +966,27 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "vte" @@ -1254,9 +1000,9 @@ dependencies = [ [[package]] name = "vte_generate_state_changes" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" dependencies = [ "proc-macro2", "quote", @@ -1273,12 +1019,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1288,70 +1033,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-bindgen" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 1.0.102", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" - -[[package]] -name = "web-sys" -version = "0.3.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "winapi" version = "0.3.9" @@ -1370,11 +1051,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -1385,196 +1066,175 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.42.1", + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.52.6", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_i686_gnu" -version = "0.48.0" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +name = "windows_x86_64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" +name = "windows_x86_64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" +name = "yansi" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] [[package]] -name = "yansi" -version = "0.5.1" +name = "zerocopy-derive" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index e0e9b920..ae2c72e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,9 +3,10 @@ members = ["crates/*"] resolver = "2" [workspace.package] +repository = "https://github.com/rust-cli/anstyle.git" license = "MIT OR Apache-2.0" edition = "2021" -rust-version = "1.70.0" # MSRV +rust-version = "1.66.0" # MSRV include = [ "build.rs", "src/**/*", @@ -16,3 +17,71 @@ include = [ "benches/**/*", "examples/**/*" ] + +[workspace.lints.rust] +rust_2018_idioms = { level = "warn", priority = -1 } +unreachable_pub = "warn" +unsafe_op_in_unsafe_fn = "warn" +unused_lifetimes = "warn" +unused_macro_rules = "warn" +unused_qualifications = "warn" + +[workspace.lints.clippy] +bool_assert_comparison = "allow" +branches_sharing_code = "allow" +checked_conversions = "warn" +collapsible_else_if = "allow" +create_dir = "warn" +dbg_macro = "warn" +debug_assert_with_mut_call = "warn" +doc_markdown = "warn" +empty_enum = "warn" +enum_glob_use = "warn" +expl_impl_clone_on_copy = "warn" +explicit_deref_methods = "warn" +explicit_into_iter_loop = "warn" +fallible_impl_from = "warn" +filter_map_next = "warn" +flat_map_option = "warn" +float_cmp_const = "warn" +fn_params_excessive_bools = "warn" +from_iter_instead_of_collect = "warn" +if_same_then_else = "allow" +implicit_clone = "warn" +imprecise_flops = "warn" +inconsistent_struct_constructor = "warn" +inefficient_to_string = "warn" +infinite_loop = "warn" +invalid_upcast_comparisons = "warn" +large_digit_groups = "warn" +large_stack_arrays = "warn" +large_types_passed_by_value = "warn" +let_and_return = "allow" # sometimes good to name what you are returning +linkedlist = "warn" +lossy_float_literal = "warn" +macro_use_imports = "warn" +mem_forget = "warn" +mutex_integer = "warn" +needless_continue = "warn" +needless_for_each = "warn" +negative_feature_names = "warn" +path_buf_push_overwrite = "warn" +ptr_as_ptr = "warn" +rc_mutex = "warn" +redundant_feature_names = "warn" +ref_option_ref = "warn" +rest_pat_in_fully_bound_structs = "warn" +same_functions_in_if_condition = "warn" +self_named_module_files = "warn" +semicolon_if_nothing_returned = "warn" +str_to_string = "warn" +string_add = "warn" +string_add_assign = "warn" +string_lit_as_bytes = "warn" +string_to_string = "warn" +todo = "warn" +trait_duplication_in_bounds = "warn" +uninlined_format_args = "warn" +verbose_file_reads = "warn" +wildcard_imports = "warn" +zero_sized_map_values = "warn" diff --git a/README.md b/README.md index dceaac1d..f86d6f62 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,16 @@ This repo contains: - [`anstyle-ls`](./crates/anstyle-ls) for parsing `LS_COLORS` style descriptions - Convert to other formats - [`anstyle-roff`](./crates/anstyle-roff) for converting ANSI codes to `ROFF` + - [`anstyle-svg`](./crates/anstyle-svg) for converting ANSI codes to `SVG` - Styling integration - [`anstyle-ansi-term`](./crates/anstyle-ansi-term) for adapting `anstyle` to `ansi_term` - [`anstyle-crossterm`](./crates/anstyle-crossterm) for adapting `anstyle` to `crossterm` - [`anstyle-owo-colors`](./crates/anstyle-owo-colors) for adapting `anstyle` to `owo-colors` + - [`anstyle-syntect`](./crates/anstyle-syntect) for adapting `anstyle` to `syntect` - [`anstyle-termcolor`](./crates/anstyle-termcolor) for adapting `anstyle` to `termcolor` - [`anstyle-yansi`](./crates/anstyle-yansi) for adapting `anstyle` to `yansi` - Utilities - [`anstyle-lossy`](./crates/anstyle-lossy) for converting between color types - [`anstyle-parse`](./crates/anstyle-parse) for parsing ANSI Style Escapes - [`anstyle-wincon`](./crates/anstyle-wincon) for styling legacy Microsoft terminals + - [`colorchoice-clap`](./crates/colorchoice-clap) for using `color` flag in `clap` diff --git a/crates/anstream/CHANGELOG.md b/crates/anstream/CHANGELOG.md index dcdc2f25..37e9a52f 100644 --- a/crates/anstream/CHANGELOG.md +++ b/crates/anstream/CHANGELOG.md @@ -7,6 +7,87 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [0.6.18] - 2024-11-04 + +### Fixes + +- Ensure `test` feature is respected by `print!` + +## [0.6.17] - 2024-10-24 + +## [0.6.16] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +### Features + +- Implement AutoStream for dyn Write + auto traits + +## [0.6.15] - 2024-07-25 + +## [0.6.14] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [0.6.13] - 2024-02-27 + +### Fixes + +- Put `NO_COLOR` above `CLICOLOR_FORCE` according to latest spec + +## [0.6.12] - 2024-02-18 + +### Fixes + +- `WinconBytes` correctly converts more escape codes + +## [0.6.11] - 2024-01-18 + +### Fixes + +- Ensure we build without `auto` (regression from 0.6.10) + +## [0.6.10] - 2024-01-18 + +### Features + +- Always expose `ColorChoice` +- Always expose `AutoStream::new` + +## [0.6.9] - 2024-01-18 + +### Features + +- Expose `Stdout` / `Stderr` types + +## [0.6.8] - 2024-01-16 + +### Fixes + +- Loosen `WinconStream` and `StripStream` trait bounds + +## [0.6.7] - 2024-01-12 + +### Fixes + +- Remove stray `dbg` + +## [0.6.6] - 2024-01-12 + +### Fixes + +- Fix soundness issue where invalid escape sequences can break up UTF-8 characters + +## [0.6.5] - 2023-12-08 + +### Fixes + +- *(windows)* Adapt ANSI-256 colors that map to ANSI colors + ## [0.6.4] - 2023-09-29 ### Fixes @@ -172,7 +253,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.0.1] - 2023-03-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.4...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.18...HEAD +[0.6.18]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.17...anstream-v0.6.18 +[0.6.17]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.16...anstream-v0.6.17 +[0.6.16]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.15...anstream-v0.6.16 +[0.6.15]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.14...anstream-v0.6.15 +[0.6.14]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.13...anstream-v0.6.14 +[0.6.13]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.12...anstream-v0.6.13 +[0.6.12]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.11...anstream-v0.6.12 +[0.6.11]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.10...anstream-v0.6.11 +[0.6.10]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.9...anstream-v0.6.10 +[0.6.9]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.8...anstream-v0.6.9 +[0.6.8]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.7...anstream-v0.6.8 +[0.6.7]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.6...anstream-v0.6.7 +[0.6.6]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.5...anstream-v0.6.6 +[0.6.5]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.4...anstream-v0.6.5 [0.6.4]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.3...anstream-v0.6.4 [0.6.3]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.2...anstream-v0.6.3 [0.6.2]: https://github.com/rust-cli/anstyle/compare/anstream-v0.6.1...anstream-v0.6.2 diff --git a/crates/anstream/Cargo.toml b/crates/anstream/Cargo.toml index 06d9d4a6..98a383bd 100644 --- a/crates/anstream/Cargo.toml +++ b/crates/anstream/Cargo.toml @@ -1,19 +1,19 @@ [package] name = "anstream" -version = "0.6.4" +version = "0.6.18" description = "A simple cross platform library for writing colored text to a terminal." -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "strip", "wincon"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true [package.metadata.docs.rs] +all-features = true rustdoc-args = ["--cfg", "docsrs"] -cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [package.metadata.release] pre-release-replacements = [ @@ -26,7 +26,7 @@ pre-release-replacements = [ [features] default = ["auto", "wincon"] -auto = ["dep:anstyle-query", "dep:colorchoice"] +auto = ["dep:anstyle-query"] wincon = ["dep:anstyle-wincon"] # Enable in `dev-dependencies` to make sure output is captured for tests test = [] @@ -34,19 +34,29 @@ test = [] [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } anstyle-parse = { version = "0.2.0", path = "../anstyle-parse" } -colorchoice = { version = "1.0.0", path = "../colorchoice", optional = true } +colorchoice = { version = "1.0.0", path = "../colorchoice" } anstyle-query = { version = "1.0.0", path = "../anstyle-query", optional = true } utf8parse = "0.2.1" +is_terminal_polyfill = "1.48" [target.'cfg(windows)'.dependencies] -anstyle-wincon = { version = "3.0.1", path = "../anstyle-wincon", optional = true } +anstyle-wincon = { version = "3.0.5", path = "../anstyle-wincon", optional = true } [dev-dependencies] -criterion = "0.5.1" -owo-colors = "3.5.0" -proptest = "1.2.0" +divan = "0.1.11" +lexopt = "0.3.0" +owo-colors = "4.0.0" +proptest = "1.4.0" strip-ansi-escapes = "0.2.0" +[[example]] +name = "dump-stream" +required-features = ["auto"] + +[[example]] +name = "query-stream" +required-features = ["auto"] + [[bench]] name = "strip" harness = false @@ -58,3 +68,6 @@ harness = false [[bench]] name = "stream" harness = false + +[lints] +workspace = true diff --git a/crates/anstream/benches/stream.rs b/crates/anstream/benches/stream.rs index f89aacf5..e0874439 100644 --- a/crates/anstream/benches/stream.rs +++ b/crates/anstream/benches/stream.rs @@ -1,81 +1,103 @@ +#![allow(clippy::unwrap_used)] + use std::io::Write as _; -use criterion::{black_box, Criterion}; - -fn stream(c: &mut Criterion) { - for (name, content) in [ - ("demo.vte", &include_bytes!("../tests/demo.vte")[..]), - ("rg_help.vte", &include_bytes!("../tests/rg_help.vte")[..]), - ("rg_linus.vte", &include_bytes!("../tests/rg_linus.vte")[..]), - ( - "state_changes", - &b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\"[..], - ), - ] { - let mut group = c.benchmark_group(name); - group.bench_function("nop", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = buffer; - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); - group.bench_function("StripStream", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = anstream::StripStream::new(buffer); - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); - #[cfg(all(windows, feature = "wincon"))] - group.bench_function("WinconStream", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = anstream::WinconStream::new(buffer); - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); - group.bench_function("AutoStream::always_ansi", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = anstream::AutoStream::always_ansi(buffer); - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); - group.bench_function("AutoStream::always", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = anstream::AutoStream::always(buffer); - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); - group.bench_function("AutoStream::never", |b| { - b.iter(|| { - let buffer = Vec::with_capacity(content.len()); - let mut stream = anstream::AutoStream::never(buffer); - - stream.write_all(content).unwrap(); - - black_box(stream) - }) - }); +#[divan::bench(args = DATA)] +fn nop(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = buffer; + + stream.write_all(data.content()).unwrap(); + + stream +} + +#[divan::bench(args = DATA)] +fn strip_stream(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = anstream::StripStream::new(buffer); + + stream.write_all(data.content()).unwrap(); + + stream.into_inner() +} + +#[divan::bench(args = DATA)] +#[cfg(all(windows, feature = "wincon"))] +fn wincon_stream(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = anstream::WinconStream::new(buffer); + + stream.write_all(data.content()).unwrap(); + + stream.into_inner() +} + +#[divan::bench(args = DATA)] +fn auto_stream_always_ansi(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = anstream::AutoStream::always_ansi(buffer); + + stream.write_all(data.content()).unwrap(); + + stream.into_inner() +} + +#[divan::bench(args = DATA)] +fn auto_stream_always(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = anstream::AutoStream::always(buffer); + + stream.write_all(data.content()).unwrap(); + + stream.into_inner() +} + +#[divan::bench(args = DATA)] +fn auto_stream_never(data: &Data) -> Vec { + let buffer = Vec::with_capacity(data.content().len()); + let mut stream = anstream::AutoStream::never(buffer); + + stream.write_all(data.content()).unwrap(); + + stream.into_inner() +} + +const DATA: &[Data] = &[ + Data( + "0-state_changes", + b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\".as_slice(), + ), + Data("1-demo.vte", include_bytes!("../tests/demo.vte").as_slice()), + Data( + "2-rg_help.vte", + include_bytes!("../tests/rg_help.vte").as_slice(), + ), + Data( + "3-rg_linus.vte", + include_bytes!("../tests/rg_linus.vte").as_slice(), + ), +]; + +#[derive(Debug)] +struct Data(&'static str, &'static [u8]); + +impl Data { + const fn name(&self) -> &'static str { + self.0 + } + + const fn content(&self) -> &'static [u8] { + self.1 } } -criterion::criterion_group!(benches, stream); -criterion::criterion_main!(benches); +impl std::fmt::Display for Data { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} + +fn main() { + divan::main(); +} diff --git a/crates/anstream/benches/strip.rs b/crates/anstream/benches/strip.rs index 9ed6178c..4770e8ca 100644 --- a/crates/anstream/benches/strip.rs +++ b/crates/anstream/benches/strip.rs @@ -1,4 +1,4 @@ -use criterion::{black_box, Criterion}; +#![allow(clippy::unwrap_used)] #[derive(Default)] struct Strip(String); @@ -19,18 +19,98 @@ impl anstyle_parse::Perform for Strip { } } -fn strip(c: &mut Criterion) { - for (name, content) in [ - ("demo.vte", &include_bytes!("../tests/demo.vte")[..]), - ("rg_help.vte", &include_bytes!("../tests/rg_help.vte")[..]), - ("rg_linus.vte", &include_bytes!("../tests/rg_linus.vte")[..]), - ( - "state_changes", - &b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\"[..], - ), - ] { +#[divan::bench(args = DATA)] +fn advance_strip(data: &Data) -> String { + let mut stripped = Strip::with_capacity(data.content().len()); + let mut parser = anstyle_parse::Parser::::new(); + + for byte in data.content() { + parser.advance(&mut stripped, *byte); + } + + stripped.0 +} + +#[divan::bench(args = DATA)] +fn strip_ansi_escapes(data: &Data) -> Vec { + let stripped = strip_ansi_escapes::strip(data.content()); + + stripped +} + +#[divan::bench(args = DATA)] +fn strip_str(data: &Data) -> String { + if let Ok(content) = std::str::from_utf8(data.content()) { + let stripped = anstream::adapter::strip_str(content).to_string(); + + stripped + } else { + "".to_owned() + } +} + +#[divan::bench(args = DATA)] +fn strip_str_strip_next(data: &Data) -> String { + if let Ok(content) = std::str::from_utf8(data.content()) { + let mut stripped = String::with_capacity(data.content().len()); + let mut state = anstream::adapter::StripStr::new(); + for printable in state.strip_next(content) { + stripped.push_str(printable); + } + + stripped + } else { + "".to_owned() + } +} + +#[divan::bench(args = DATA)] +fn strip_bytes(data: &Data) -> Vec { + let stripped = anstream::adapter::strip_bytes(data.content()).into_vec(); + + stripped +} + +const DATA: &[Data] = &[ + Data( + "0-state_changes", + b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\".as_slice(), + ), + Data("1-demo.vte", include_bytes!("../tests/demo.vte").as_slice()), + Data( + "2-rg_help.vte", + include_bytes!("../tests/rg_help.vte").as_slice(), + ), + Data( + "3-rg_linus.vte", + include_bytes!("../tests/rg_linus.vte").as_slice(), + ), +]; + +#[derive(Debug)] +struct Data(&'static str, &'static [u8]); + +impl Data { + const fn name(&self) -> &'static str { + self.0 + } + + const fn content(&self) -> &'static [u8] { + self.1 + } +} + +impl std::fmt::Display for Data { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} + +#[test] +fn verify_data() { + for data in DATA { // Make sure the comparison is fair - if let Ok(content) = std::str::from_utf8(content) { + if let Ok(content) = std::str::from_utf8(data.content()) { let mut stripped = Strip::with_capacity(content.len()); let mut parser = anstyle_parse::Parser::::new(); for byte in content.as_bytes() { @@ -46,57 +126,9 @@ fn strip(c: &mut Criterion) { .unwrap() ); } - - let mut group = c.benchmark_group(name); - group.bench_function("advance_strip", |b| { - b.iter(|| { - let mut stripped = Strip::with_capacity(content.len()); - let mut parser = - anstyle_parse::Parser::::new(); - - for byte in content { - parser.advance(&mut stripped, *byte); - } - - black_box(stripped.0) - }) - }); - group.bench_function("strip_ansi_escapes", |b| { - b.iter(|| { - let stripped = strip_ansi_escapes::strip(content); - - black_box(stripped) - }) - }); - if let Ok(content) = std::str::from_utf8(content) { - group.bench_function("strip_str", |b| { - b.iter(|| { - let stripped = anstream::adapter::strip_str(content).to_string(); - - black_box(stripped) - }) - }); - group.bench_function("StripStr", |b| { - b.iter(|| { - let mut stripped = String::with_capacity(content.len()); - let mut state = anstream::adapter::StripStr::new(); - for printable in state.strip_next(content) { - stripped.push_str(printable); - } - - black_box(stripped) - }) - }); - } - group.bench_function("strip_bytes", |b| { - b.iter(|| { - let stripped = anstream::adapter::strip_bytes(content).into_vec(); - - black_box(stripped) - }) - }); } } -criterion::criterion_group!(benches, strip); -criterion::criterion_main!(benches); +fn main() { + divan::main(); +} diff --git a/crates/anstream/benches/wincon.rs b/crates/anstream/benches/wincon.rs index 54e1f80a..a0a28308 100644 --- a/crates/anstream/benches/wincon.rs +++ b/crates/anstream/benches/wincon.rs @@ -1,26 +1,46 @@ -use criterion::{black_box, Criterion}; +#[divan::bench(args = DATA)] +fn nop(data: &Data) -> Vec<(anstyle::Style, String)> { + let mut state = anstream::adapter::WinconBytes::new(); + let stripped = state.extract_next(data.content()).collect::>(); -fn wincon(c: &mut Criterion) { - for (name, content) in [ - ("demo.vte", &include_bytes!("../tests/demo.vte")[..]), - ("rg_help.vte", &include_bytes!("../tests/rg_help.vte")[..]), - ("rg_linus.vte", &include_bytes!("../tests/rg_linus.vte")[..]), - ( - "state_changes", - &b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\"[..], - ), - ] { - let mut group = c.benchmark_group(name); - group.bench_function("wincon_bytes", |b| { - b.iter(|| { - let mut state = anstream::adapter::WinconBytes::new(); - let stripped = state.extract_next(content).collect::>(); + stripped +} + +const DATA: &[Data] = &[ + Data( + "0-state_changes", + b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\".as_slice(), + ), + Data("1-demo.vte", include_bytes!("../tests/demo.vte").as_slice()), + Data( + "2-rg_help.vte", + include_bytes!("../tests/rg_help.vte").as_slice(), + ), + Data( + "3-rg_linus.vte", + include_bytes!("../tests/rg_linus.vte").as_slice(), + ), +]; + +#[derive(Debug)] +struct Data(&'static str, &'static [u8]); + +impl Data { + const fn name(&self) -> &'static str { + self.0 + } - black_box(stripped) - }) - }); + const fn content(&self) -> &'static [u8] { + self.1 } } -criterion::criterion_group!(benches, wincon); -criterion::criterion_main!(benches); +impl std::fmt::Display for Data { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} + +fn main() { + divan::main(); +} diff --git a/crates/anstream/examples/dump-stream.rs b/crates/anstream/examples/dump-stream.rs new file mode 100644 index 00000000..18bd2eb2 --- /dev/null +++ b/crates/anstream/examples/dump-stream.rs @@ -0,0 +1,130 @@ +//! Write colored text, adapting to the terminals capabilities + +use std::io::Write; + +fn main() -> Result<(), lexopt::Error> { + let args = Args::parse()?; + let stdout = anstream::stdout(); + let mut stdout = stdout.lock(); + + for fixed in 0..16 { + let color = anstyle::Ansi256Color(fixed) + .into_ansi() + .expect("within 4-bit color range"); + let style = style(color, args.layer, args.effects); + let _ = print_number(&mut stdout, fixed, style); + if fixed == 7 || fixed == 15 { + let _ = writeln!(&mut stdout); + } + } + + for fixed in 16..232 { + let col = (fixed - 16) % 36; + if col == 0 { + let _ = writeln!(stdout); + } + let color = anstyle::Ansi256Color(fixed); + let style = style(color, args.layer, args.effects); + let _ = print_number(&mut stdout, fixed, style); + } + + let _ = writeln!(stdout); + let _ = writeln!(stdout); + for fixed in 232..=255 { + let color = anstyle::Ansi256Color(fixed); + let style = style(color, args.layer, args.effects); + let _ = print_number(&mut stdout, fixed, style); + } + + let _ = writeln!(stdout); + + Ok(()) +} + +fn style( + color: impl Into, + layer: Layer, + effects: anstyle::Effects, +) -> anstyle::Style { + let color = color.into(); + (match layer { + Layer::Fg => anstyle::Style::new().fg_color(Some(color)), + Layer::Bg => anstyle::Style::new().bg_color(Some(color)), + Layer::Underline => anstyle::Style::new().underline_color(Some(color)), + }) | effects +} + +fn print_number(stdout: &mut impl Write, fixed: u8, style: anstyle::Style) -> std::io::Result<()> { + write!(stdout, "{style}{fixed:>3X}{style:#}",) +} + +#[derive(Default)] +struct Args { + effects: anstyle::Effects, + layer: Layer, +} + +#[derive(Copy, Clone, Default)] +enum Layer { + #[default] + Fg, + Bg, + Underline, +} + +impl Args { + fn parse() -> Result { + use lexopt::prelude::*; + + let mut res = Args::default(); + + let mut args = lexopt::Parser::from_env(); + while let Some(arg) = args.next()? { + match arg { + Long("layer") => { + res.layer = args.value()?.parse_with(|s| match s { + "fg" => Ok(Layer::Fg), + "bg" => Ok(Layer::Bg), + "underline" => Ok(Layer::Underline), + _ => Err("expected values fg, bg, underline"), + })?; + } + Long("effect") => { + const EFFECTS: [(&str, anstyle::Effects); 12] = [ + ("bold", anstyle::Effects::BOLD), + ("dimmed", anstyle::Effects::DIMMED), + ("italic", anstyle::Effects::ITALIC), + ("underline", anstyle::Effects::UNDERLINE), + ("double_underline", anstyle::Effects::DOUBLE_UNDERLINE), + ("curly_underline", anstyle::Effects::CURLY_UNDERLINE), + ("dotted_underline", anstyle::Effects::DOTTED_UNDERLINE), + ("dashed_underline", anstyle::Effects::DASHED_UNDERLINE), + ("blink", anstyle::Effects::BLINK), + ("invert", anstyle::Effects::INVERT), + ("hidden", anstyle::Effects::HIDDEN), + ("strikethrough", anstyle::Effects::STRIKETHROUGH), + ]; + let effect = args.value()?.parse_with(|s| { + EFFECTS + .into_iter() + .find(|(name, _)| *name == s) + .map(|(_, effect)| effect) + .ok_or_else(|| { + format!( + "expected one of {}", + EFFECTS + .into_iter() + .map(|(n, _)| n) + .collect::>() + .join(", ") + ) + }) + })?; + res.effects = res.effects.insert(effect); + } + _ => return Err(arg.unexpected()), + } + } + Ok(res) + } +} diff --git a/crates/anstream/examples/query-stream.rs b/crates/anstream/examples/query-stream.rs new file mode 100644 index 00000000..1c8670ec --- /dev/null +++ b/crates/anstream/examples/query-stream.rs @@ -0,0 +1,22 @@ +//! Report a terminal's capabilities + +fn main() { + println!("stdout:"); + println!( + " choice: {:?}", + anstream::AutoStream::choice(&std::io::stdout()) + ); + println!( + " choice: {:?}", + anstream::AutoStream::auto(std::io::stdout()).current_choice() + ); + println!("stderr:"); + println!( + " choice: {:?}", + anstream::AutoStream::choice(&std::io::stderr()) + ); + println!( + " choice: {:?}", + anstream::AutoStream::auto(std::io::stderr()).current_choice() + ); +} diff --git a/crates/anstream/src/macros.rs b/crates/anstream/src/_macros.rs similarity index 79% rename from crates/anstream/src/macros.rs rename to crates/anstream/src/_macros.rs index bd1accb0..71d4ce68 100644 --- a/crates/anstream/src/macros.rs +++ b/crates/anstream/src/_macros.rs @@ -60,18 +60,9 @@ #[macro_export] macro_rules! print { ($($arg:tt)*) => {{ - if cfg!(any(feature = "test", test)) { - use std::io::Write as _; - - let stdio = std::io::stdout(); - let choice = $crate::AutoStream::choice(&stdio); - let buffer = Vec::new(); - let mut stream = $crate::AutoStream::new(buffer, choice); - // Ignore errors rather than panic - let _ = ::std::write!(&mut stream, $($arg)*); - let buffer = stream.into_inner(); - // Should be UTF-8 but not wanting to panic - let buffer = String::from_utf8_lossy(&buffer); + if cfg!(test) || $crate::_macros::FEATURE_TEST_ACTIVATED { + let target_stream = std::io::stdout(); + let buffer = $crate::_macros::to_adapted_string(&format_args!($($arg)*), &target_stream); ::std::print!("{}", buffer) } else { use std::io::Write as _; @@ -141,18 +132,9 @@ macro_rules! println { $crate::print!("\n") }; ($($arg:tt)*) => {{ - if cfg!(any(feature = "test", test)) { - use std::io::Write as _; - - let stdio = std::io::stdout(); - let choice = $crate::AutoStream::choice(&stdio); - let buffer = Vec::new(); - let mut stream = $crate::AutoStream::new(buffer, choice); - // Ignore errors rather than panic - let _ = ::std::write!(&mut stream, $($arg)*); - let buffer = stream.into_inner(); - // Should be UTF-8 but not wanting to panic - let buffer = String::from_utf8_lossy(&buffer); + if cfg!(test) || $crate::_macros::FEATURE_TEST_ACTIVATED { + let target_stream = std::io::stdout(); + let buffer = $crate::_macros::to_adapted_string(&format_args!($($arg)*), &target_stream); ::std::println!("{}", buffer) } else { use std::io::Write as _; @@ -201,18 +183,9 @@ macro_rules! println { #[macro_export] macro_rules! eprint { ($($arg:tt)*) => {{ - if cfg!(any(feature = "test", test)) { - use std::io::Write as _; - - let stdio = std::io::stderr(); - let choice = $crate::AutoStream::choice(&stdio); - let buffer = Vec::new(); - let mut stream = $crate::AutoStream::new(buffer, choice); - // Ignore errors rather than panic - let _ = ::std::write!(&mut stream, $($arg)*); - let buffer = stream.into_inner(); - // Should be UTF-8 but not wanting to panic - let buffer = String::from_utf8_lossy(&buffer); + if cfg!(test) || $crate::_macros::FEATURE_TEST_ACTIVATED { + let target_stream = std::io::stderr(); + let buffer = $crate::_macros::to_adapted_string(&format_args!($($arg)*), &target_stream); ::std::eprint!("{}", buffer) } else { use std::io::Write as _; @@ -220,7 +193,7 @@ macro_rules! eprint { let mut stream = $crate::stderr(); match ::std::write!(&mut stream, $($arg)*) { Err(e) if e.kind() != ::std::io::ErrorKind::BrokenPipe => { - ::std::panic!("failed printing to stdout: {e}"); + ::std::panic!("failed printing to stderr: {e}"); } Err(_) | Ok(_) => {} } @@ -264,18 +237,9 @@ macro_rules! eprintln { $crate::eprint!("\n") }; ($($arg:tt)*) => {{ - if cfg!(any(feature = "test", test)) { - use std::io::Write as _; - - let stdio = std::io::stderr(); - let choice = $crate::AutoStream::choice(&stdio); - let buffer = Vec::new(); - let mut stream = $crate::AutoStream::new(buffer, choice); - // Ignore errors rather than panic - let _ = ::std::write!(&mut stream, $($arg)*); - let buffer = stream.into_inner(); - // Should be UTF-8 but not wanting to panic - let buffer = String::from_utf8_lossy(&buffer); + if cfg!(test) || $crate::_macros::FEATURE_TEST_ACTIVATED { + let target_stream = std::io::stderr(); + let buffer = $crate::_macros::to_adapted_string(&format_args!($($arg)*), &target_stream); ::std::eprintln!("{}", buffer) } else { use std::io::Write as _; @@ -283,7 +247,7 @@ macro_rules! eprintln { let mut stream = $crate::stderr(); match ::std::writeln!(&mut stream, $($arg)*) { Err(e) if e.kind() != ::std::io::ErrorKind::BrokenPipe => { - ::std::panic!("failed printing to stdout: {e}"); + ::std::panic!("failed printing to stderr: {e}"); } Err(_) | Ok(_) => {} } @@ -373,17 +337,29 @@ macro_rules! panic { ::std::panic!() }; ($($arg:tt)*) => {{ - use std::io::Write as _; - - let panic_stream = std::io::stderr(); - let choice = $crate::AutoStream::choice(&panic_stream); - let buffer = Vec::new(); - let mut stream = $crate::AutoStream::new(buffer, choice); - // Ignore errors rather than panic - let _ = ::std::write!(&mut stream, $($arg)*); - let buffer = stream.into_inner(); - // Should be UTF-8 but not wanting to panic - let buffer = String::from_utf8_lossy(&buffer).into_owned(); + let target_stream = std::io::stderr(); + let buffer = $crate::_macros::to_adapted_string(&format_args!($($arg)*), &target_stream); ::std::panic!("{}", buffer) }}; } + +#[cfg(feature = "auto")] +pub const FEATURE_TEST_ACTIVATED: bool = cfg!(feature = "test"); + +#[cfg(feature = "auto")] +pub fn to_adapted_string( + display: &dyn std::fmt::Display, + stream: &impl crate::stream::RawStream, +) -> String { + use std::io::Write as _; + + let choice = crate::AutoStream::choice(stream); + let buffer = Vec::new(); + let mut stream = crate::AutoStream::new(buffer, choice); + // Ignore errors rather than panic + let _ = ::std::write!(&mut stream, "{display}"); + let buffer = stream.into_inner(); + // Should be UTF-8 but not wanting to panic + let buffer = String::from_utf8_lossy(&buffer).into_owned(); + buffer +} diff --git a/crates/anstream/src/adapter/strip.rs b/crates/anstream/src/adapter/strip.rs index 5078c515..e7371f52 100644 --- a/crates/anstream/src/adapter/strip.rs +++ b/crates/anstream/src/adapter/strip.rs @@ -45,7 +45,7 @@ impl<'s> StrippedStr<'s> { pub fn to_string(&self) -> String { use std::fmt::Write as _; let mut stripped = String::with_capacity(self.bytes.len()); - let _ = write!(&mut stripped, "{}", self); + let _ = write!(&mut stripped, "{self}"); stripped } } @@ -118,7 +118,7 @@ fn next_str<'s>(bytes: &mut &'s [u8], state: &mut State) -> Option<&'s str> { if next_state != State::Anywhere { *state = next_state; } - is_printable_str(action, b) + is_printable_bytes(action, b) }); let (_, next) = bytes.split_at(offset.unwrap_or(bytes.len())); *bytes = next; @@ -126,7 +126,7 @@ fn next_str<'s>(bytes: &mut &'s [u8], state: &mut State) -> Option<&'s str> { let offset = bytes.iter().copied().position(|b| { let (_next_state, action) = state_change(State::Ground, b); - !is_printable_str(action, b) + !(is_printable_bytes(action, b) || is_utf8_continuation(b)) }); let (printable, next) = bytes.split_at(offset.unwrap_or(bytes.len())); *bytes = next; @@ -145,27 +145,16 @@ fn next_str<'s>(bytes: &mut &'s [u8], state: &mut State) -> Option<&'s str> { #[inline] unsafe fn from_utf8_unchecked<'b>(bytes: &'b [u8], safety_justification: &'static str) -> &'b str { - if cfg!(debug_assertions) { - // Catch problems more quickly when testing - std::str::from_utf8(bytes).expect(safety_justification) - } else { - std::str::from_utf8_unchecked(bytes) + unsafe { + if cfg!(debug_assertions) { + // Catch problems more quickly when testing + std::str::from_utf8(bytes).expect(safety_justification) + } else { + std::str::from_utf8_unchecked(bytes) + } } } -#[inline] -fn is_printable_str(action: Action, byte: u8) -> bool { - // VT320 considered 0x7f to be `Print`able but we expect to be working in UTF-8 systems and not - // ISO Latin-1, making it DEL and non-printable - const DEL: u8 = 0x7f; - (action == Action::Print && byte != DEL) - || action == Action::BeginUtf8 - // since we know the input is valid UTF-8, the only thing we can do with - // continuations is to print them - || is_utf8_continuation(byte) - || (action == Action::Execute && byte.is_ascii_whitespace()) -} - #[inline] fn is_utf8_continuation(b: u8) -> bool { matches!(b, 0x80..=0xbf) @@ -340,7 +329,7 @@ fn next_bytes<'s>( } #[derive(Default, Clone, Debug, PartialEq, Eq)] -pub struct Utf8Parser { +pub(crate) struct Utf8Parser { utf8_parser: utf8parse::Parser, } @@ -453,7 +442,7 @@ mod test { fn test_strip_byte_multibyte() { let bytes = [240, 145, 141, 139]; let expected = parser_strip(&bytes); - let actual = String::from_utf8(strip_byte(&bytes).to_vec()).unwrap(); + let actual = String::from_utf8(strip_byte(&bytes).clone()).unwrap(); assert_eq!(expected, actual); } @@ -469,10 +458,19 @@ mod test { fn test_strip_byte_del() { let bytes = [0x7f]; let expected = ""; - let actual = String::from_utf8(strip_byte(&bytes).to_vec()).unwrap(); + let actual = String::from_utf8(strip_byte(&bytes).clone()).unwrap(); assert_eq!(expected, actual); } + #[test] + fn test_strip_str_handles_broken_sequence() { + // valid utf8: \xc3\xb6 then \x1b then \xf0\x9f\x98\x80 + let s = "ö\x1b😀hello😀goodbye"; + let mut it = strip_str(s); + assert_eq!("ö", it.next().unwrap()); + assert_eq!("ello😀goodbye", it.next().unwrap()); + } + proptest! { #[test] #[cfg_attr(miri, ignore)] // See https://github.com/AltSysrq/proptest/issues/253 @@ -506,7 +504,7 @@ mod test { dbg!(&s); dbg!(s.as_bytes()); let expected = parser_strip(s.as_bytes()); - let actual = String::from_utf8(strip_byte(s.as_bytes()).to_vec()).unwrap(); + let actual = String::from_utf8(strip_byte(s.as_bytes()).clone()).unwrap(); assert_eq!(expected, actual); } } diff --git a/crates/anstream/src/adapter/wincon.rs b/crates/anstream/src/adapter/wincon.rs index 71edc4cf..f879e828 100644 --- a/crates/anstream/src/adapter/wincon.rs +++ b/crates/anstream/src/adapter/wincon.rs @@ -105,11 +105,12 @@ impl anstyle_parse::Perform for WinconCapture { } let mut style = self.style; + // param/value differences are dependent on the escape code + let mut state = State::Normal; + let mut r = None; + let mut g = None; + let mut color_target = ColorTarget::Fg; for param in params { - let mut state = State::Normal; - let mut r = None; - let mut g = None; - let mut is_bg = false; for value in param { match (state, *value) { (State::Normal, 0) => { @@ -120,17 +121,41 @@ impl anstyle_parse::Perform for WinconCapture { style = style.bold(); break; } + (State::Normal, 2) => { + style = style.dimmed(); + break; + } + (State::Normal, 3) => { + style = style.italic(); + break; + } (State::Normal, 4) => { style = style.underline(); + state = State::Underline; + } + (State::Normal, 21) => { + style |= anstyle::Effects::DOUBLE_UNDERLINE; + break; + } + (State::Normal, 7) => { + style = style.invert(); + break; + } + (State::Normal, 8) => { + style = style.hidden(); + break; + } + (State::Normal, 9) => { + style = style.strikethrough(); break; } (State::Normal, 30..=37) => { - let color = to_ansi_color(value - 30).unwrap(); + let color = to_ansi_color(value - 30).expect("within 4-bit range"); style = style.fg_color(Some(color.into())); break; } (State::Normal, 38) => { - is_bg = false; + color_target = ColorTarget::Fg; state = State::PrepareCustomColor; } (State::Normal, 39) => { @@ -138,25 +163,33 @@ impl anstyle_parse::Perform for WinconCapture { break; } (State::Normal, 40..=47) => { - let color = to_ansi_color(value - 40).unwrap(); + let color = to_ansi_color(value - 40).expect("within 4-bit range"); style = style.bg_color(Some(color.into())); break; } (State::Normal, 48) => { - is_bg = true; + color_target = ColorTarget::Bg; state = State::PrepareCustomColor; } (State::Normal, 49) => { style = style.bg_color(None); break; } + (State::Normal, 58) => { + color_target = ColorTarget::Underline; + state = State::PrepareCustomColor; + } (State::Normal, 90..=97) => { - let color = to_ansi_color(value - 90).unwrap().bright(true); + let color = to_ansi_color(value - 90) + .expect("within 4-bit range") + .bright(true); style = style.fg_color(Some(color.into())); break; } (State::Normal, 100..=107) => { - let color = to_ansi_color(value - 100).unwrap().bright(true); + let color = to_ansi_color(value - 100) + .expect("within 4-bit range") + .bright(true); style = style.bg_color(Some(color.into())); break; } @@ -170,11 +203,11 @@ impl anstyle_parse::Perform for WinconCapture { } (State::Ansi256, n) => { let color = anstyle::Ansi256Color(n as u8); - if is_bg { - style = style.bg_color(Some(color.into())); - } else { - style = style.fg_color(Some(color.into())); - } + style = match color_target { + ColorTarget::Fg => style.fg_color(Some(color.into())), + ColorTarget::Bg => style.bg_color(Some(color.into())), + ColorTarget::Underline => style.underline_color(Some(color.into())), + }; break; } (State::Rgb, b) => match (r, g) { @@ -186,14 +219,41 @@ impl anstyle_parse::Perform for WinconCapture { } (Some(r), Some(g)) => { let color = anstyle::RgbColor(r as u8, g as u8, b as u8); - if is_bg { - style = style.bg_color(Some(color.into())); - } else { - style = style.fg_color(Some(color.into())); - } + style = match color_target { + ColorTarget::Fg => style.fg_color(Some(color.into())), + ColorTarget::Bg => style.bg_color(Some(color.into())), + ColorTarget::Underline => style.underline_color(Some(color.into())), + }; break; } }, + (State::Underline, 0) => { + style = + style.effects(style.get_effects().remove(anstyle::Effects::UNDERLINE)); + } + (State::Underline, 1) => { + // underline already set + } + (State::Underline, 2) => { + style = style + .effects(style.get_effects().remove(anstyle::Effects::UNDERLINE)) + | anstyle::Effects::DOUBLE_UNDERLINE; + } + (State::Underline, 3) => { + style = style + .effects(style.get_effects().remove(anstyle::Effects::UNDERLINE)) + | anstyle::Effects::CURLY_UNDERLINE; + } + (State::Underline, 4) => { + style = style + .effects(style.get_effects().remove(anstyle::Effects::UNDERLINE)) + | anstyle::Effects::DOTTED_UNDERLINE; + } + (State::Underline, 5) => { + style = style + .effects(style.get_effects().remove(anstyle::Effects::UNDERLINE)) + | anstyle::Effects::DASHED_UNDERLINE; + } _ => { break; } @@ -214,6 +274,14 @@ enum State { PrepareCustomColor, Ansi256, Rgb, + Underline, +} + +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +enum ColorTarget { + Fg, + Bg, + Underline, } fn to_ansi_color(digit: u16) -> Option { @@ -244,7 +312,7 @@ mod test { .collect::>(); let mut state = WinconBytes::new(); let actual = state.extract_next(input.as_bytes()).collect::>(); - assert_eq!(expected, actual); + assert_eq!(expected, actual, "{input:?}"); } #[test] @@ -287,6 +355,21 @@ mod test { verify(&input, expected); } + #[test] + fn ansi256_colors() { + // termcolor only supports "brights" via these + let input = format!( + "Hello {}!", + "world".color(owo_colors::XtermColors::UserBrightYellow) + ); + let expected = vec![ + (anstyle::Style::default(), "Hello "), + (anstyle::Ansi256Color(11).on_default(), "world"), + (anstyle::Style::default(), "!"), + ]; + verify(&input, expected); + } + proptest! { #[test] #[cfg_attr(miri, ignore)] // See https://github.com/AltSysrq/proptest/issues/253 diff --git a/crates/anstream/src/auto.rs b/crates/anstream/src/auto.rs index 7aaac6ae..743640f8 100644 --- a/crates/anstream/src/auto.rs +++ b/crates/anstream/src/auto.rs @@ -1,12 +1,20 @@ use crate::stream::AsLockedWrite; use crate::stream::RawStream; -#[cfg(feature = "auto")] use crate::ColorChoice; use crate::StripStream; #[cfg(all(windows, feature = "wincon"))] use crate::WinconStream; /// [`std::io::Write`] that adapts ANSI escape codes to the underlying `Write`s capabilities +/// +/// This includes +/// - Stripping colors for non-terminals +/// - Respecting env variables like [NO_COLOR](https://no-color.org/) or [CLICOLOR](https://bixense.com/clicolors/) +/// - *(windows)* Falling back to the wincon API where [ENABLE_VIRTUAL_TERMINAL_PROCESSING](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences) is unsupported +/// +/// You can customize auto-detection by calling into +/// [anstyle_query](https://docs.rs/anstyle-query/latest/anstyle_query/) +/// to get a [`ColorChoice`] and then calling [`AutoStream::new(stream, choice)`]. #[derive(Debug)] pub struct AutoStream { inner: StreamInner, @@ -25,11 +33,38 @@ where S: RawStream, { /// Runtime control over styling behavior - #[cfg(feature = "auto")] + /// + /// # Example + /// + /// ```rust + /// # #[cfg(feature = "auto")] { + /// # use std::io::IsTerminal as _; + /// // Like `AutoStream::choice` but without `NO_COLOR`, `CLICOLOR_FORCE`, `CI` + /// fn choice(raw: &dyn anstream::stream::RawStream) -> anstream::ColorChoice { + /// let choice = anstream::ColorChoice::global(); + /// if choice == anstream::ColorChoice::Auto { + /// if raw.is_terminal() && anstyle_query::term_supports_color() { + /// anstream::ColorChoice::Always + /// } else { + /// anstream::ColorChoice::Never + /// } + /// } else { + /// choice + /// } + /// } + /// + /// let stream = std::io::stdout(); + /// let choice = choice(&stream); + /// let auto = anstream::AutoStream::new(stream, choice); + /// # } + /// ``` #[inline] pub fn new(raw: S, choice: ColorChoice) -> Self { match choice { + #[cfg(feature = "auto")] ColorChoice::Auto => Self::auto(raw), + #[cfg(not(feature = "auto"))] + ColorChoice::Auto => Self::never(raw), ColorChoice::AlwaysAnsi => Self::always_ansi(raw), ColorChoice::Always => Self::always(raw), ColorChoice::Never => Self::never(raw), @@ -122,6 +157,7 @@ where } } + /// Returns `true` if the descriptor/handle refers to a terminal/tty. #[inline] pub fn is_terminal(&self) -> bool { match &self.inner { @@ -155,13 +191,16 @@ fn choice(raw: &dyn RawStream) -> ColorChoice { let clicolor = anstyle_query::clicolor(); let clicolor_enabled = clicolor.unwrap_or(false); let clicolor_disabled = !clicolor.unwrap_or(true); - if raw.is_terminal() - && !anstyle_query::no_color() - && !clicolor_disabled + if anstyle_query::no_color() { + ColorChoice::Never + } else if anstyle_query::clicolor_force() { + ColorChoice::Always + } else if clicolor_disabled { + ColorChoice::Never + } else if raw.is_terminal() && (anstyle_query::term_supports_color() || clicolor_enabled || anstyle_query::is_ci()) - || anstyle_query::clicolor_force() { ColorChoice::Always } else { diff --git a/crates/anstream/src/buffer.rs b/crates/anstream/src/buffer.rs index 9846bb7c..92e5aafe 100644 --- a/crates/anstream/src/buffer.rs +++ b/crates/anstream/src/buffer.rs @@ -54,15 +54,3 @@ impl anstyle_wincon::WinconStream for Buffer { self.0.write_colored(fg, bg, data) } } - -#[cfg(all(windows, feature = "wincon"))] -impl anstyle_wincon::WinconStream for &'_ mut Buffer { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} diff --git a/crates/anstream/src/lib.rs b/crates/anstream/src/lib.rs index 97211390..73ff8bf9 100644 --- a/crates/anstream/src/lib.rs +++ b/crates/anstream/src/lib.rs @@ -3,7 +3,7 @@ //! *A portmanteau of "ansi stream"* //! //! [`AutoStream`] always accepts [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code), -//! adapting to the user's terminal's capabilities. +//! [adapting to the user's terminal's capabilities][AutoStream]. //! //! Benefits //! - Allows the caller to not be concerned with the terminal's capabilities @@ -12,7 +12,6 @@ //! //! Available styling crates: //! - [anstyle](https://docs.rs/anstyle) for minimal runtime styling, designed to go in public APIs -//! (once it hits 1.0) //! - [owo-colors](https://docs.rs/owo-colors) for feature-rich runtime styling //! - [color-print](https://docs.rs/color-print) for feature-rich compile-time styling //! @@ -33,14 +32,18 @@ //! And this will correctly handle piping to a file, etc #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] pub mod adapter; pub mod stream; - -mod buffer; +#[doc(hidden)] #[macro_use] -mod macros; +pub mod _macros; + mod auto; +mod buffer; mod fmt; mod strip; #[cfg(all(windows, feature = "wincon"))] @@ -54,12 +57,17 @@ pub use wincon::WinconStream; #[allow(deprecated)] pub use buffer::Buffer; +/// An adaptive wrapper around the global standard output stream of the current process +pub type Stdout = AutoStream; +/// An adaptive wrapper around the global standard error stream of the current process +pub type Stderr = AutoStream; + /// Create an ANSI escape code compatible stdout /// /// **Note:** Call [`AutoStream::lock`] in loops to avoid the performance hit of acquiring/releasing /// from the implicit locking in each [`std::io::Write`] call #[cfg(feature = "auto")] -pub fn stdout() -> AutoStream { +pub fn stdout() -> Stdout { let stdout = std::io::stdout(); AutoStream::auto(stdout) } @@ -69,11 +77,10 @@ pub fn stdout() -> AutoStream { /// **Note:** Call [`AutoStream::lock`] in loops to avoid the performance hit of acquiring/releasing /// from the implicit locking in each [`std::io::Write`] call #[cfg(feature = "auto")] -pub fn stderr() -> AutoStream { +pub fn stderr() -> Stderr { let stderr = std::io::stderr(); AutoStream::auto(stderr) } /// Selection for overriding color output -#[cfg(feature = "auto")] pub use colorchoice::ColorChoice; diff --git a/crates/anstream/src/stream.rs b/crates/anstream/src/stream.rs index e2f7e68d..b45be042 100644 --- a/crates/anstream/src/stream.rs +++ b/crates/anstream/src/stream.rs @@ -11,121 +11,115 @@ pub trait RawStream: { } +impl RawStream for &mut T {} +impl RawStream for Box {} + impl RawStream for std::io::Stdout {} impl RawStream for std::io::StdoutLock<'_> {} -impl RawStream for &'_ mut std::io::StdoutLock<'_> {} - impl RawStream for std::io::Stderr {} impl RawStream for std::io::StderrLock<'_> {} -impl RawStream for &'_ mut std::io::StderrLock<'_> {} - -impl RawStream for Box {} - -impl RawStream for &'_ mut Box {} +impl RawStream for dyn std::io::Write {} +impl RawStream for dyn std::io::Write + Send {} +impl RawStream for dyn std::io::Write + Send + Sync {} impl RawStream for Vec {} -impl RawStream for &'_ mut Vec {} - impl RawStream for std::fs::File {} -impl RawStream for &'_ mut std::fs::File {} - #[allow(deprecated)] impl RawStream for crate::Buffer {} -#[allow(deprecated)] -impl RawStream for &'_ mut crate::Buffer {} - +/// Trait to determine if a descriptor/handle refers to a terminal/tty. pub trait IsTerminal: private::Sealed { + /// Returns `true` if the descriptor/handle refers to a terminal/tty. fn is_terminal(&self) -> bool; } -impl IsTerminal for std::io::Stdout { +impl IsTerminal for &T { #[inline] fn is_terminal(&self) -> bool { - std::io::IsTerminal::is_terminal(self) + (**self).is_terminal() } } -impl IsTerminal for std::io::StdoutLock<'_> { +impl IsTerminal for &mut T { #[inline] fn is_terminal(&self) -> bool { - std::io::IsTerminal::is_terminal(self) + (**self).is_terminal() } } -impl IsTerminal for &'_ mut std::io::StdoutLock<'_> { +impl IsTerminal for Box { #[inline] fn is_terminal(&self) -> bool { (**self).is_terminal() } } -impl IsTerminal for std::io::Stderr { +impl IsTerminal for std::io::Stdout { #[inline] fn is_terminal(&self) -> bool { - std::io::IsTerminal::is_terminal(self) + is_terminal_polyfill::IsTerminal::is_terminal(self) } } -impl IsTerminal for std::io::StderrLock<'_> { +impl IsTerminal for std::io::StdoutLock<'_> { #[inline] fn is_terminal(&self) -> bool { - std::io::IsTerminal::is_terminal(self) + is_terminal_polyfill::IsTerminal::is_terminal(self) } } -impl IsTerminal for &'_ mut std::io::StderrLock<'_> { +impl IsTerminal for std::io::Stderr { #[inline] fn is_terminal(&self) -> bool { - (**self).is_terminal() + is_terminal_polyfill::IsTerminal::is_terminal(self) } } -impl IsTerminal for Box { +impl IsTerminal for std::io::StderrLock<'_> { #[inline] fn is_terminal(&self) -> bool { - false + is_terminal_polyfill::IsTerminal::is_terminal(self) } } -impl IsTerminal for &'_ mut Box { +impl IsTerminal for dyn std::io::Write { #[inline] fn is_terminal(&self) -> bool { false } } -impl IsTerminal for Vec { +impl IsTerminal for dyn std::io::Write + Send { #[inline] fn is_terminal(&self) -> bool { false } } -impl IsTerminal for &'_ mut Vec { +impl IsTerminal for dyn std::io::Write + Send + Sync { #[inline] fn is_terminal(&self) -> bool { false } } -impl IsTerminal for std::fs::File { +impl IsTerminal for Vec { #[inline] fn is_terminal(&self) -> bool { - std::io::IsTerminal::is_terminal(self) + false } } -impl IsTerminal for &'_ mut std::fs::File { +impl IsTerminal for std::fs::File { #[inline] fn is_terminal(&self) -> bool { - (**self).is_terminal() + is_terminal_polyfill::IsTerminal::is_terminal(self) } } @@ -137,20 +131,39 @@ impl IsTerminal for crate::Buffer { } } -#[allow(deprecated)] -impl IsTerminal for &'_ mut crate::Buffer { +/// Lock a stream +pub trait AsLockedWrite: private::Sealed { + /// Locked writer type + type Write<'w>: RawStream + 'w + where + Self: 'w; + + /// Lock a stream + fn as_locked_write(&mut self) -> Self::Write<'_>; +} + +impl AsLockedWrite for &mut T { + type Write<'w> + = T::Write<'w> + where + Self: 'w; + #[inline] - fn is_terminal(&self) -> bool { - (**self).is_terminal() + fn as_locked_write(&mut self) -> Self::Write<'_> { + (**self).as_locked_write() } } -pub trait AsLockedWrite: private::Sealed { - type Write<'w>: RawStream + 'w +impl AsLockedWrite for Box { + type Write<'w> + = T::Write<'w> where Self: 'w; - fn as_locked_write(&mut self) -> Self::Write<'_>; + #[inline] + fn as_locked_write(&mut self) -> Self::Write<'_> { + (**self).as_locked_write() + } } impl AsLockedWrite for std::io::Stdout { @@ -189,7 +202,25 @@ impl AsLockedWrite for std::io::StderrLock<'static> { } } -impl AsLockedWrite for Box { +impl AsLockedWrite for dyn std::io::Write { + type Write<'w> = &'w mut Self; + + #[inline] + fn as_locked_write(&mut self) -> Self::Write<'_> { + self + } +} + +impl AsLockedWrite for dyn std::io::Write + Send { + type Write<'w> = &'w mut Self; + + #[inline] + fn as_locked_write(&mut self) -> Self::Write<'_> { + self + } +} + +impl AsLockedWrite for dyn std::io::Write + Send + Sync { type Write<'w> = &'w mut Self; #[inline] @@ -229,33 +260,56 @@ impl AsLockedWrite for crate::Buffer { mod private { pub trait Sealed {} + impl Sealed for &T {} + impl Sealed for &mut T {} + impl Sealed for Box {} + impl Sealed for std::io::Stdout {} impl Sealed for std::io::StdoutLock<'_> {} - impl Sealed for &'_ mut std::io::StdoutLock<'_> {} - impl Sealed for std::io::Stderr {} impl Sealed for std::io::StderrLock<'_> {} - impl Sealed for &'_ mut std::io::StderrLock<'_> {} - - impl Sealed for Box {} - - impl Sealed for &'_ mut Box {} + impl Sealed for dyn std::io::Write {} + impl Sealed for dyn std::io::Write + Send {} + impl Sealed for dyn std::io::Write + Send + Sync {} impl Sealed for Vec {} - impl Sealed for &'_ mut Vec {} - impl Sealed for std::fs::File {} - impl Sealed for &'_ mut std::fs::File {} - #[allow(deprecated)] impl Sealed for crate::Buffer {} +} - #[allow(deprecated)] - impl Sealed for &'_ mut crate::Buffer {} +#[cfg(test)] +mod tests { + use super::*; + + fn assert_raw_stream() + where + crate::AutoStream: std::io::Write, + { + } + + #[test] + fn test() { + assert_raw_stream::>(); + assert_raw_stream::>(); + assert_raw_stream::>(); + assert_raw_stream::>(); + + assert_raw_stream::<&mut (dyn std::io::Write)>(); + assert_raw_stream::<&mut (dyn std::io::Write + 'static)>(); + assert_raw_stream::<&mut (dyn std::io::Write + Send)>(); + assert_raw_stream::<&mut (dyn std::io::Write + Send + Sync)>(); + + assert_raw_stream::>(); + assert_raw_stream::<&mut Vec>(); + + assert_raw_stream::(); + assert_raw_stream::<&mut std::fs::File>(); + } } diff --git a/crates/anstream/src/strip.rs b/crates/anstream/src/strip.rs index d7fda04a..9f0d28bd 100644 --- a/crates/anstream/src/strip.rs +++ b/crates/anstream/src/strip.rs @@ -1,12 +1,12 @@ use crate::adapter::StripBytes; use crate::stream::AsLockedWrite; -use crate::stream::RawStream; +use crate::stream::IsTerminal; /// Only pass printable data to the inner `Write` #[derive(Debug)] pub struct StripStream where - S: RawStream, + S: std::io::Write, { raw: S, state: StripBytes, @@ -14,7 +14,7 @@ where impl StripStream where - S: RawStream, + S: std::io::Write, { /// Only pass printable data to the inner `Write` #[inline] @@ -25,12 +25,19 @@ where } } - /// Get the wrapped [`RawStream`] + /// Get the wrapped [`std::io::Write`] #[inline] pub fn into_inner(self) -> S { self.raw } +} +impl StripStream +where + S: std::io::Write, + S: IsTerminal, +{ + /// Returns `true` if the descriptor/handle refers to a terminal/tty. #[inline] pub fn is_terminal(&self) -> bool { self.raw.is_terminal() @@ -69,7 +76,8 @@ impl StripStream { impl std::io::Write for StripStream where - S: RawStream + AsLockedWrite, + S: std::io::Write, + S: AsLockedWrite, { // Must forward all calls to ensure locking happens appropriately #[inline] diff --git a/crates/anstream/src/wincon.rs b/crates/anstream/src/wincon.rs index a5aa5e74..206e052e 100644 --- a/crates/anstream/src/wincon.rs +++ b/crates/anstream/src/wincon.rs @@ -1,13 +1,13 @@ use crate::adapter::WinconBytes; use crate::stream::AsLockedWrite; -use crate::stream::RawStream; +use crate::stream::IsTerminal; /// Only pass printable data to the inner `Write` #[cfg(feature = "wincon")] // here mostly for documentation purposes #[derive(Debug)] pub struct WinconStream where - S: RawStream, + S: anstyle_wincon::WinconStream, { raw: S, // `WinconBytes` is especially large compared to other variants of `AutoStream`, so boxing it @@ -18,7 +18,7 @@ where impl WinconStream where - S: RawStream, + S: anstyle_wincon::WinconStream, { /// Only pass printable data to the inner `Write` #[inline] @@ -29,12 +29,18 @@ where } } - /// Get the wrapped [`RawStream`] + /// Get the wrapped [`anstyle_wincon::WinconStream`] #[inline] pub fn into_inner(self) -> S { self.raw } +} +impl WinconStream +where + S: anstyle_wincon::WinconStream, + S: IsTerminal, +{ #[inline] pub fn is_terminal(&self) -> bool { self.raw.is_terminal() @@ -73,7 +79,8 @@ impl WinconStream { impl std::io::Write for WinconStream where - S: RawStream + AsLockedWrite, + S: anstyle_wincon::WinconStream, + S: AsLockedWrite, { // Must forward all calls to ensure locking happens appropriately #[inline] @@ -105,7 +112,11 @@ where } } -fn write(raw: &mut dyn RawStream, state: &mut WinconBytes, buf: &[u8]) -> std::io::Result { +fn write( + raw: &mut dyn anstyle_wincon::WinconStream, + state: &mut WinconBytes, + buf: &[u8], +) -> std::io::Result { for (style, printable) in state.extract_next(buf) { let fg = style.get_fg_color().and_then(cap_wincon_color); let bg = style.get_bg_color().and_then(cap_wincon_color); @@ -119,7 +130,11 @@ fn write(raw: &mut dyn RawStream, state: &mut WinconBytes, buf: &[u8]) -> std::i Ok(buf.len()) } -fn write_all(raw: &mut dyn RawStream, state: &mut WinconBytes, buf: &[u8]) -> std::io::Result<()> { +fn write_all( + raw: &mut dyn anstyle_wincon::WinconStream, + state: &mut WinconBytes, + buf: &[u8], +) -> std::io::Result<()> { for (style, printable) in state.extract_next(buf) { let mut buf = printable.as_bytes(); let fg = style.get_fg_color().and_then(cap_wincon_color); @@ -142,7 +157,7 @@ fn write_all(raw: &mut dyn RawStream, state: &mut WinconBytes, buf: &[u8]) -> st } fn write_fmt( - raw: &mut dyn RawStream, + raw: &mut dyn anstyle_wincon::WinconStream, state: &mut WinconBytes, args: std::fmt::Arguments<'_>, ) -> std::io::Result<()> { diff --git a/crates/anstyle-ansi-term/CHANGELOG.md b/crates/anstyle-ansi-term/CHANGELOG.md index c1fe371e..f9ac9b29 100644 --- a/crates/anstyle-ansi-term/CHANGELOG.md +++ b/crates/anstyle-ansi-term/CHANGELOG.md @@ -7,9 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.0.3] - 2024-10-24 + ### Compatibility -- Update MSRV to 1.70.0 +- Update MSRV to 1.66 + +## [1.0.2] - 2024-07-25 + +## [1.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 ## [1.0.0] - 2023-04-13 @@ -28,7 +38,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-08-17 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v1.0.3...HEAD +[1.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v1.0.2...anstyle-ansi-term-v1.0.3 +[1.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v1.0.1...anstyle-ansi-term-v1.0.2 +[1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v1.0.0...anstyle-ansi-term-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v0.2.0...anstyle-ansi-term-v1.0.0 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v0.1.2...anstyle-ansi-term-v0.2.0 [0.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-ansi-term-v0.1.1...anstyle-ansi-term-v0.1.2 diff --git a/crates/anstyle-ansi-term/Cargo.toml b/crates/anstyle-ansi-term/Cargo.toml index 365ca478..141fa677 100644 --- a/crates/anstyle-ansi-term/Cargo.toml +++ b/crates/anstyle-ansi-term/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-ansi-term" -version = "1.0.0" +version = "1.0.3" description = "Adapt between ansi_term and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "ansi_term"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,7 +24,9 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } ansi_term = "0.12.1" + +[lints] +workspace = true diff --git a/crates/anstyle-ansi-term/README.md b/crates/anstyle-ansi-term/README.md index 44fdffa6..c5a37118 100644 --- a/crates/anstyle-ansi-term/README.md +++ b/crates/anstyle-ansi-term/README.md @@ -1,6 +1,6 @@ # anstyle-ansi-term -> Convert from color styling types to [`ansi_term`](https://lib.rs/ansi_term) color types +> Convert between [`ansi_term`](https://lib.rs/ansi_term) and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-ansi-term.svg) diff --git a/crates/anstyle-ansi-term/src/lib.rs b/crates/anstyle-ansi-term/src/lib.rs index 10ed7e80..f3d0bbab 100644 --- a/crates/anstyle-ansi-term/src/lib.rs +++ b/crates/anstyle-ansi-term/src/lib.rs @@ -1,19 +1,11 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn to_ansi_term(self) -> ansi_term::Style; -} +//! Convert between [`ansi_term`](https://lib.rs/ansi_term) and generic styling types -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn to_ansi_term(self) -> ansi_term::Style { - to_ansi_term(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Adapt generic styling to [`ansi_term`] pub fn to_ansi_term(astyle: anstyle::Style) -> ansi_term::Style { let mut style = ansi_term::Style::new(); diff --git a/crates/anstyle-crossterm/CHANGELOG.md b/crates/anstyle-crossterm/CHANGELOG.md index de9366fb..1858dd21 100644 --- a/crates/anstyle-crossterm/CHANGELOG.md +++ b/crates/anstyle-crossterm/CHANGELOG.md @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [3.0.1] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [3.0.0] - 2024-08-01 + +### Breaking Change + +- Update crossterm to 0.28 + +## [2.0.2] - 2024-07-25 + +## [2.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + ## [2.0.0] - 2023-09-28 ### Breaking Change @@ -32,7 +52,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-10-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v2.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v3.0.1...HEAD +[3.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v3.0.0...anstyle-crossterm-v3.0.1 +[3.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v2.0.2...anstyle-crossterm-v3.0.0 +[2.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v2.0.1...anstyle-crossterm-v2.0.2 +[2.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v2.0.0...anstyle-crossterm-v2.0.1 [2.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v1.0.0...anstyle-crossterm-v2.0.0 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v0.2.0...anstyle-crossterm-v1.0.0 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-crossterm-v0.1.1...anstyle-crossterm-v0.2.0 diff --git a/crates/anstyle-crossterm/Cargo.toml b/crates/anstyle-crossterm/Cargo.toml index d7443b8b..0424e972 100644 --- a/crates/anstyle-crossterm/Cargo.toml +++ b/crates/anstyle-crossterm/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-crossterm" -version = "2.0.0" +version = "3.0.1" description = "Adapt between crossterm and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "crossterm"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -22,4 +26,7 @@ pre-release-replacements = [ [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } -crossterm = { version = "0.27.0", default-features = false, features = ["windows"] } +crossterm = { version = "0.28.0", default-features = false, features = ["windows"] } + +[lints] +workspace = true diff --git a/crates/anstyle-crossterm/README.md b/crates/anstyle-crossterm/README.md index 7a2a1341..dd03ddd2 100644 --- a/crates/anstyle-crossterm/README.md +++ b/crates/anstyle-crossterm/README.md @@ -1,6 +1,6 @@ # anstyle-crossterm -> Convert from color styling types to [`crossterm`](https://lib.rs/crossterm) color types +> Convert between [`crossterm`](https://lib.rs/crossterm) and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-crossterm.svg) diff --git a/crates/anstyle-crossterm/src/lib.rs b/crates/anstyle-crossterm/src/lib.rs index 7793caa5..ba844447 100644 --- a/crates/anstyle-crossterm/src/lib.rs +++ b/crates/anstyle-crossterm/src/lib.rs @@ -1,19 +1,11 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn to_crossterm(self) -> crossterm::style::ContentStyle; -} +//! Convert between [`crossterm`](https://lib.rs/crossterm) and [generic styling types][anstyle] -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn to_crossterm(self) -> crossterm::style::ContentStyle { - to_crossterm(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Adapt generic styling to [`crossterm`] pub fn to_crossterm(astyle: anstyle::Style) -> crossterm::style::ContentStyle { let foreground_color = astyle.get_fg_color().map(to_ansi_color); let background_color = astyle.get_bg_color().map(to_ansi_color); diff --git a/crates/anstyle-git/CHANGELOG.md b/crates/anstyle-git/CHANGELOG.md index 1592d814..356b085e 100644 --- a/crates/anstyle-git/CHANGELOG.md +++ b/crates/anstyle-git/CHANGELOG.md @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.1.2] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [1.1.1] - 2024-07-25 + +## [1.1.0] - 2024-07-14 + +### Features + +- Add support for `#RGB` 12-bit colors + +## [1.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + ### Compatibility - Update MSRV to 1.70.0 @@ -30,7 +50,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.2.1] - 2022-05-19 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.1.2...HEAD +[1.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.1.1...anstyle-git-v1.1.2 +[1.1.1]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.1.0...anstyle-git-v1.1.1 +[1.1.0]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.0.1...anstyle-git-v1.1.0 +[1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v1.0.0...anstyle-git-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v0.3.0...anstyle-git-v1.0.0 [0.3.0]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v0.2.3...anstyle-git-v0.3.0 [0.2.3]: https://github.com/rust-cli/anstyle/compare/anstyle-git-v0.2.2...anstyle-git-v0.2.3 diff --git a/crates/anstyle-git/Cargo.toml b/crates/anstyle-git/Cargo.toml index a47f48bc..33c18466 100644 --- a/crates/anstyle-git/Cargo.toml +++ b/crates/anstyle-git/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-git" -version = "1.0.0" +version = "1.1.2" description = "Parse Git Style Descriptions" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "git", "colorparse"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,6 +24,8 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } + +[lints] +workspace = true diff --git a/crates/anstyle-git/src/lib.rs b/crates/anstyle-git/src/lib.rs index b0eb2696..f8623999 100644 --- a/crates/anstyle-git/src/lib.rs +++ b/crates/anstyle-git/src/lib.rs @@ -11,24 +11,13 @@ //! assert_eq!(hyperlink_style, anstyle::RgbColor(0x00, 0x00, 0xee).on_default() | anstyle::Effects::UNDERLINE); //! ``` -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed + Sized { - fn parse_git(s: &str) -> Result; -} - -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn parse_git(s: &str) -> Result { - parse(s) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] /// Parse a string in Git's color configuration syntax into an -/// `anstyle::Style`. +/// [`anstyle::Style`]. pub fn parse(s: &str) -> Result { let mut style = anstyle::Style::new(); let mut num_colors = 0; @@ -90,15 +79,15 @@ pub fn parse(s: &str) -> Result { } _ => { return Err(Error::ExtraColor { - style: s.to_string(), - word: word.to_string(), + style: s.to_owned(), + word: word.to_owned(), }); } } } else { return Err(Error::UnknownWord { - style: s.to_string(), - word: word.to_string(), + style: s.to_owned(), + word: word.to_owned(), }); } } @@ -121,11 +110,16 @@ fn parse_color(word: &str) -> Result, ()> { "cyan" => Some(anstyle::AnsiColor::Cyan.into()), "white" => Some(anstyle::AnsiColor::White.into()), _ => { - if word.starts_with('#') && word.len() == 7 { + if let Some(hex) = word.strip_prefix('#') { + let l = hex.len(); + if l != 3 && l != 6 { + return Err(()); + } + let l = l / 3; if let (Ok(r), Ok(g), Ok(b)) = ( - u8::from_str_radix(&word[1..3], 16), - u8::from_str_radix(&word[3..5], 16), - u8::from_str_radix(&word[5..7], 16), + u8::from_str_radix(&hex[0..l], 16), + u8::from_str_radix(&hex[l..(2 * l)], 16), + u8::from_str_radix(&hex[(2 * l)..(3 * l)], 16), ) { Some(anstyle::Color::from((r, g, b))) } else { @@ -146,26 +140,34 @@ fn parse_color(word: &str) -> Result, ()> { #[non_exhaustive] pub enum Error { /// An extra color appeared after the foreground and background colors. - ExtraColor { style: String, word: String }, + ExtraColor { + /// Original style + style: String, + /// Extra color + word: String, + }, /// An unknown word appeared. - UnknownWord { style: String, word: String }, + UnknownWord { + /// Original style + style: String, + /// Unknown word + word: String, + }, } impl std::fmt::Display for Error { - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { + fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::ExtraColor { style, word } => { write!( fmt, - "Error parsing style \"{}\": extra color \"{}\"", - style, word + "Error parsing style \"{style}\": extra color \"{word}\"" ) } Self::UnknownWord { style, word } => { write!( fmt, - "Error parsing style \"{}\": unknown word: \"{}\"", - style, word + "Error parsing style \"{style}\": unknown word: \"{word}\"" ) } } @@ -213,6 +215,14 @@ mod tests { test!("255 -1" => Ansi256Color(255).on_default()); test!("#000000" => RgbColor(0,0,0).on_default()); test!("#204060" => RgbColor(0x20,0x40,0x60).on_default()); + test!("#1a2b3c" => RgbColor(0x1a,0x2b,0x3c).on_default()); + test!("#000" => RgbColor(0,0,0).on_default()); + test!("#cba" => RgbColor(0xc,0xb,0xa).on_default()); + test!("#cba " => RgbColor(0xc,0xb,0xa).on_default()); + test!("#987 #135" => RgbColor(9,8,7).on(RgbColor(1, 3, 5))); + test!("#987 #135 " => RgbColor(9,8,7).on(RgbColor(1, 3, 5))); + test!("#123 #abcdef" => RgbColor(1,2,3).on(RgbColor(0xab, 0xcd, 0xef))); + test!("#654321 #a9b" => RgbColor(0x65,0x43,0x21).on(RgbColor(0xa, 0x9, 0xb))); test!("bold cyan white" => Cyan.on(White).bold()); test!("bold cyan nobold white" => Cyan.on(White)); @@ -222,6 +232,8 @@ mod tests { test!("italic cyan white" => Cyan.on(White).italic()); test!("strike cyan white" => Cyan.on(White).strikethrough()); test!("blink #050505 white" => RgbColor(5,5,5).on(White).blink()); + test!("bold #987 green" => RgbColor(9,8,7).on(Green).bold()); + test!("strike #147 #cba" => RgbColor(1,4,7).on(RgbColor(0xc, 0xb, 0xa)).strikethrough()); } #[test] @@ -231,8 +243,8 @@ mod tests { assert_eq!( parse($s), Err($err { - style: $s.to_string(), - word: $word.to_string() + style: $s.to_owned(), + word: $word.to_owned() }) ); }; @@ -245,6 +257,9 @@ mod tests { test!("red blue -1" => ExtraColor "-1"); test!("yellow green #abcdef" => ExtraColor "#abcdef"); test!("#123456 #654321 #abcdef" => ExtraColor "#abcdef"); + test!("#123 #654 #abc" => ExtraColor "#abc"); + test!("#123 #654 #abcdef" => ExtraColor "#abcdef"); + test!("#123456 #654321 #abc" => ExtraColor "#abc"); test!("bold red blue green" => ExtraColor "green"); test!("red bold blue green" => ExtraColor "green"); test!("red blue bold green" => ExtraColor "green"); @@ -266,16 +281,16 @@ mod tests { test!("no-green" => UnknownWord "no-green"); test!("no-#123456" => UnknownWord "no-#123456"); test!("#" => UnknownWord "#"); + test!("#1" => UnknownWord "#1"); + test!("#12" => UnknownWord "#12"); + test!("#1234" => UnknownWord "#1234"); test!("#12345" => UnknownWord "#12345"); test!("#1234567" => UnknownWord "#1234567"); + test!("#12345678" => UnknownWord "#12345678"); + test!("#123456789" => UnknownWord "#123456789"); + test!("#123456789abc" => UnknownWord "#123456789abc"); test!("#bcdefg" => UnknownWord "#bcdefg"); test!("#blue" => UnknownWord "#blue"); test!("blue#123456" => UnknownWord "blue#123456"); } - - #[test] - fn test_extension_trait() { - let style = anstyle::Style::parse_git("red blue"); - assert_eq!(style.unwrap(), Red.on(Blue)); - } } diff --git a/crates/anstyle-lossy/CHANGELOG.md b/crates/anstyle-lossy/CHANGELOG.md index eb7f93e4..e28b5067 100644 --- a/crates/anstyle-lossy/CHANGELOG.md +++ b/crates/anstyle-lossy/CHANGELOG.md @@ -7,10 +7,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.1.3] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [1.1.2] - 2024-07-25 + +## [1.1.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [1.1.0] - 2024-02-18 + ### Compatibility - Update MSRV to 1.70.0 +### Feaures + +- Expose palette API + +### Fixes + +- Fixed panic + ## [1.0.0] - 2023-04-13 ### Breaking Change @@ -26,7 +50,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-10-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.1.3...HEAD +[1.1.3]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.1.2...anstyle-lossy-v1.1.3 +[1.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.1.1...anstyle-lossy-v1.1.2 +[1.1.1]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.1.0...anstyle-lossy-v1.1.1 +[1.1.0]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v1.0.0...anstyle-lossy-v1.1.0 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v0.2.0...anstyle-lossy-v1.0.0 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-lossy-v0.1.1...anstyle-lossy-v0.2.0 [0.1.1]: https://github.com/rust-cli/anstyle/compare/b31a85851f2104407bbbced9e24e0ca71021e3f8...anstyle-lossy-v0.1.1 diff --git a/crates/anstyle-lossy/Cargo.toml b/crates/anstyle-lossy/Cargo.toml index f49f1e77..d61ca66e 100644 --- a/crates/anstyle-lossy/Cargo.toml +++ b/crates/anstyle-lossy/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-lossy" -version = "1.0.0" +version = "1.1.3" description = "Lossy conversion between ANSI Color Codes" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,6 +24,8 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } + +[lints] +workspace = true diff --git a/crates/anstyle-lossy/src/lib.rs b/crates/anstyle-lossy/src/lib.rs index e2916fa8..e0e868e1 100644 --- a/crates/anstyle-lossy/src/lib.rs +++ b/crates/anstyle-lossy/src/lib.rs @@ -1,7 +1,18 @@ +//! Lossy conversion between ANSI Color Codes + +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] + pub mod palette; use anstyle::RgbColor as Rgb; +/// Lossily convert from any color to RGB +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn color_to_rgb(color: anstyle::Color, palette: palette::Palette) -> anstyle::RgbColor { match color { anstyle::Color::Ansi(color) => ansi_to_rgb(color, palette), @@ -10,6 +21,10 @@ pub const fn color_to_rgb(color: anstyle::Color, palette: palette::Palette) -> a } } +/// Lossily convert from any color to 256-color +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn color_to_xterm(color: anstyle::Color) -> anstyle::Ansi256Color { match color { anstyle::Color::Ansi(color) => anstyle::Ansi256Color::from_ansi(color), @@ -18,6 +33,10 @@ pub const fn color_to_xterm(color: anstyle::Color) -> anstyle::Ansi256Color { } } +/// Lossily convert from any color to 4-bit color +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn color_to_ansi(color: anstyle::Color, palette: palette::Palette) -> anstyle::AnsiColor { match color { anstyle::Color::Ansi(color) => color, @@ -26,6 +45,10 @@ pub const fn color_to_ansi(color: anstyle::Color, palette: palette::Palette) -> } } +/// Lossily convert from 4-bit color to RGB +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn ansi_to_rgb( color: anstyle::AnsiColor, palette: palette::Palette, @@ -33,6 +56,10 @@ pub const fn ansi_to_rgb( palette.rgb_from_ansi(color) } +/// Lossily convert from 256-color to RGB +/// +/// As 256-color palette is a superset of 4-bit colors and since the palette for 4-bit colors is +/// terminal/user defined, a [`palette::Palette`] must be provided to match against. pub const fn xterm_to_rgb( color: anstyle::Ansi256Color, palette: palette::Palette, @@ -43,6 +70,10 @@ pub const fn xterm_to_rgb( } } +/// Lossily convert from the 256-color palette to 4-bit color +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn xterm_to_ansi( color: anstyle::Ansi256Color, palette: palette::Palette, @@ -71,6 +102,10 @@ pub const fn xterm_to_ansi( } } +/// Lossily convert an RGB value to a 4-bit color +/// +/// As the palette for 4-bit colors is terminal/user defined, a [`palette::Palette`] must be +/// provided to match against. pub const fn rgb_to_ansi( color: anstyle::RgbColor, palette: palette::Palette, @@ -78,6 +113,7 @@ pub const fn rgb_to_ansi( palette.find_match(color) } +/// Lossily convert an RGB value to the 256-color palette pub const fn rgb_to_xterm(color: anstyle::RgbColor) -> anstyle::Ansi256Color { // Skip placeholders let index = find_xterm_match(color); diff --git a/crates/anstyle-lossy/src/palette.rs b/crates/anstyle-lossy/src/palette.rs index a41f193a..17922f7b 100644 --- a/crates/anstyle-lossy/src/palette.rs +++ b/crates/anstyle-lossy/src/palette.rs @@ -1,19 +1,32 @@ //! Popular color palettes for [`anstyle::AnsiColor`] //! //! Based on [wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit) +use anstyle::RgbColor as Rgb; +/// A color palette for rendering 4-bit [`anstyle::AnsiColor`] +#[allow(clippy::exhaustive_structs)] #[derive(Copy, Clone, PartialEq, Eq, Debug)] -pub struct Palette([anstyle::RgbColor; 16]); +pub struct Palette(pub RawPalette); +type RawPalette = [Rgb; 16]; impl Palette { - pub(crate) const fn rgb_from_ansi(&self, color: anstyle::AnsiColor) -> anstyle::RgbColor { + /// Look up the [`anstyle::RgbColor`] in the palette + pub const fn get(&self, color: anstyle::AnsiColor) -> Rgb { let color = anstyle::Ansi256Color::from_ansi(color); - self.0[color.index() as usize] + *self.get_ansi256_ref(color) + } + const fn get_ansi256_ref(&self, color: anstyle::Ansi256Color) -> &Rgb { + let index = color.index() as usize; + &self.0[index] + } + + pub(crate) const fn rgb_from_ansi(&self, color: anstyle::AnsiColor) -> anstyle::RgbColor { + self.get(color) } pub(crate) const fn rgb_from_index(&self, index: u8) -> Option { let index = index as usize; - if index <= self.0.len() { + if index < self.0.len() { Some(self.0[index]) } else { None @@ -35,15 +48,14 @@ impl Palette { index += 1; } - match anstyle::Ansi256Color(best_index as u8).into_ansi() { - Some(color) => color, - None => { - // Panic - #[allow(clippy::no_effect)] - ["best_index is out of bounds"][best_index]; - // Make compiler happy - anstyle::AnsiColor::Black - } + if let Some(color) = anstyle::Ansi256Color(best_index as u8).into_ansi() { + color + } else { + // Panic + #[allow(clippy::no_effect)] + ["best_index is out of bounds"][best_index]; + // Make compiler happy + anstyle::AnsiColor::Black } } } @@ -54,46 +66,66 @@ impl Default for Palette { } } +impl std::ops::Index for Palette { + type Output = Rgb; + + #[inline] + fn index(&self, color: anstyle::AnsiColor) -> &Rgb { + let color = anstyle::Ansi256Color::from_ansi(color); + self.get_ansi256_ref(color) + } +} + +impl From for Palette { + fn from(raw: RawPalette) -> Self { + Self(raw) + } +} + +/// Platform-specific default #[cfg(not(windows))] pub use VGA as DEFAULT; +/// Platform-specific default #[cfg(windows)] pub use WIN10_CONSOLE as DEFAULT; +/// Typical colors that are used when booting PCs and leaving them in text mode pub const VGA: Palette = Palette([ - anstyle::RgbColor(0, 0, 0), - anstyle::RgbColor(170, 0, 0), - anstyle::RgbColor(0, 170, 0), - anstyle::RgbColor(170, 85, 0), - anstyle::RgbColor(0, 0, 170), - anstyle::RgbColor(170, 0, 170), - anstyle::RgbColor(0, 170, 170), - anstyle::RgbColor(170, 170, 170), - anstyle::RgbColor(85, 85, 85), - anstyle::RgbColor(255, 85, 85), - anstyle::RgbColor(85, 255, 85), - anstyle::RgbColor(255, 255, 85), - anstyle::RgbColor(85, 85, 255), - anstyle::RgbColor(255, 85, 255), - anstyle::RgbColor(85, 255, 255), - anstyle::RgbColor(255, 255, 255), + Rgb(0, 0, 0), + Rgb(170, 0, 0), + Rgb(0, 170, 0), + Rgb(170, 85, 0), + Rgb(0, 0, 170), + Rgb(170, 0, 170), + Rgb(0, 170, 170), + Rgb(170, 170, 170), + Rgb(85, 85, 85), + Rgb(255, 85, 85), + Rgb(85, 255, 85), + Rgb(255, 255, 85), + Rgb(85, 85, 255), + Rgb(255, 85, 255), + Rgb(85, 255, 255), + Rgb(255, 255, 255), ]); +/// Campbell theme, used as of Windows 10 version 1709. pub const WIN10_CONSOLE: Palette = Palette([ - anstyle::RgbColor(12, 12, 12), - anstyle::RgbColor(197, 15, 31), - anstyle::RgbColor(19, 161, 14), - anstyle::RgbColor(193, 156, 0), - anstyle::RgbColor(0, 55, 218), - anstyle::RgbColor(136, 23, 152), - anstyle::RgbColor(58, 150, 221), - anstyle::RgbColor(204, 204, 204), - anstyle::RgbColor(118, 118, 118), - anstyle::RgbColor(231, 72, 86), - anstyle::RgbColor(22, 198, 12), - anstyle::RgbColor(249, 241, 165), - anstyle::RgbColor(59, 120, 255), - anstyle::RgbColor(180, 0, 158), - anstyle::RgbColor(97, 214, 214), - anstyle::RgbColor(242, 242, 242), + Rgb(12, 12, 12), + Rgb(197, 15, 31), + Rgb(19, 161, 14), + Rgb(193, 156, 0), + Rgb(0, 55, 218), + Rgb(136, 23, 152), + Rgb(58, 150, 221), + Rgb(204, 204, 204), + Rgb(118, 118, 118), + Rgb(231, 72, 86), + Rgb(22, 198, 12), + Rgb(249, 241, 165), + Rgb(59, 120, 255), + Rgb(180, 0, 158), + Rgb(97, 214, 214), + Rgb(242, 242, 242), ]); diff --git a/crates/anstyle-ls/CHANGELOG.md b/crates/anstyle-ls/CHANGELOG.md index 0449a1b1..18716524 100644 --- a/crates/anstyle-ls/CHANGELOG.md +++ b/crates/anstyle-ls/CHANGELOG.md @@ -7,9 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.0.4] - 2024-10-24 + ### Compatibility -- Update MSRV to 1.70.0 +- Update MSRV to 1.66 + +## [1.0.3] - 2024-07-25 + +## [1.0.2] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 ## [1.0.1] - 2023-06-20 @@ -28,7 +38,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-10-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.1...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.4...HEAD +[1.0.4]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.3...anstyle-ls-v1.0.4 +[1.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.2...anstyle-ls-v1.0.3 +[1.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.1...anstyle-ls-v1.0.2 [1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v1.0.0...anstyle-ls-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v0.2.0...anstyle-ls-v1.0.0 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-ls-v0.1.1...anstyle-ls-v0.2.0 diff --git a/crates/anstyle-ls/Cargo.toml b/crates/anstyle-ls/Cargo.toml index 22502d9e..ad020e03 100644 --- a/crates/anstyle-ls/Cargo.toml +++ b/crates/anstyle-ls/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-ls" -version = "1.0.1" +version = "1.0.4" description = "Parse LS_COLORS Style Descriptions" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "ls", "colorparse"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,6 +24,8 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } + +[lints] +workspace = true diff --git a/crates/anstyle-ls/src/lib.rs b/crates/anstyle-ls/src/lib.rs index 3a7e6457..d185368f 100644 --- a/crates/anstyle-ls/src/lib.rs +++ b/crates/anstyle-ls/src/lib.rs @@ -8,21 +8,10 @@ //! assert_eq!(style, anstyle::AnsiColor::Blue.on_default() | anstyle::Effects::ITALIC); //! ``` -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed + Sized { - fn parse_ls(code: &str) -> Option; -} - -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn parse_ls(code: &str) -> Option { - parse(code) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] /// Parse a string in `LS_COLORS`'s color configuration syntax into an /// `ansi_term::Style`. @@ -93,7 +82,7 @@ pub fn parse(code: &str) -> Option { (Some(5), Some(color)) => fg_color = Some(anstyle::Ansi256Color(color).into()), (Some(2), Some(red)) => match (parts.pop_front(), parts.pop_front()) { (Some(green), Some(blue)) => { - fg_color = Some(anstyle::RgbColor(red, green, blue).into()) + fg_color = Some(anstyle::RgbColor(red, green, blue).into()); } _ => { break; @@ -116,7 +105,7 @@ pub fn parse(code: &str) -> Option { (Some(5), Some(color)) => bg_color = Some(anstyle::Ansi256Color(color).into()), (Some(2), Some(red)) => match (parts.pop_front(), parts.pop_front()) { (Some(green), Some(blue)) => { - bg_color = Some(anstyle::RgbColor(red, green, blue).into()) + bg_color = Some(anstyle::RgbColor(red, green, blue).into()); } _ => { break; @@ -129,11 +118,11 @@ pub fn parse(code: &str) -> Option { 49 => bg_color = None, 58 => match (parts.pop_front(), parts.pop_front()) { (Some(5), Some(color)) => { - underline_color = Some(anstyle::Ansi256Color(color).into()) + underline_color = Some(anstyle::Ansi256Color(color).into()); } (Some(2), Some(red)) => match (parts.pop_front(), parts.pop_front()) { (Some(green), Some(blue)) => { - underline_color = Some(anstyle::RgbColor(red, green, blue).into()) + underline_color = Some(anstyle::RgbColor(red, green, blue).into()); } _ => { break; @@ -181,7 +170,7 @@ mod tests { #[track_caller] fn assert_style(code: &str, expected: impl Into) { - let actual = anstyle::Style::parse_ls(code).unwrap(); + let actual = parse(code).unwrap(); let expected = expected.into(); assert_eq!(actual, expected); } @@ -206,9 +195,9 @@ mod tests { #[test] fn parse_reject() { - assert_eq!(None, anstyle::Style::parse_ls("a")); - assert_eq!(None, anstyle::Style::parse_ls("1;")); - assert_eq!(None, anstyle::Style::parse_ls("33; 42")); + assert_eq!(None, parse("a")); + assert_eq!(None, parse("1;")); + assert_eq!(None, parse("33; 42")); } #[test] diff --git a/crates/anstyle-owo-colors/CHANGELOG.md b/crates/anstyle-owo-colors/CHANGELOG.md index f7caca29..ece70820 100644 --- a/crates/anstyle-owo-colors/CHANGELOG.md +++ b/crates/anstyle-owo-colors/CHANGELOG.md @@ -7,8 +7,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [2.0.3] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [2.0.2] - 2024-07-25 + +## [2.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [2.0.0] - 2024-02-18 + ### Compatibility +- Update to owo-colors v4 - Update MSRV to 1.70.0 ## [1.0.1] - 2023-07-06 @@ -38,7 +55,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-05-18 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v1.0.1...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v2.0.3...HEAD +[2.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v2.0.2...anstyle-owo-colors-v2.0.3 +[2.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v2.0.1...anstyle-owo-colors-v2.0.2 +[2.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v2.0.0...anstyle-owo-colors-v2.0.1 +[2.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v1.0.1...anstyle-owo-colors-v2.0.0 [1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v1.0.0...anstyle-owo-colors-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v0.3.0...anstyle-owo-colors-v1.0.0 [0.3.0]: https://github.com/rust-cli/anstyle/compare/anstyle-owo-colors-v0.2.2...anstyle-owo-colors-v0.3.0 diff --git a/crates/anstyle-owo-colors/Cargo.toml b/crates/anstyle-owo-colors/Cargo.toml index 2fc35016..cb1a7927 100644 --- a/crates/anstyle-owo-colors/Cargo.toml +++ b/crates/anstyle-owo-colors/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-owo-colors" -version = "1.0.1" +version = "2.0.3" description = "Adapt between owo-colors and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "owo-colors"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,7 +24,9 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } -owo-colors = "3.5.0" +owo-colors = "4.0.0" + +[lints] +workspace = true diff --git a/crates/anstyle-owo-colors/README.md b/crates/anstyle-owo-colors/README.md index 2c71fbe2..e59e6ae5 100644 --- a/crates/anstyle-owo-colors/README.md +++ b/crates/anstyle-owo-colors/README.md @@ -1,6 +1,6 @@ # anstyle-owo-colors -> Convert from color styling types to [owo-colors](https://lib.rs/owo-colors) color types +> Convert between [owo-colors](https://lib.rs/owo-colors) and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-owo-colors.svg) diff --git a/crates/anstyle-owo-colors/src/lib.rs b/crates/anstyle-owo-colors/src/lib.rs index 6c45cefa..4e9625f1 100644 --- a/crates/anstyle-owo-colors/src/lib.rs +++ b/crates/anstyle-owo-colors/src/lib.rs @@ -1,19 +1,11 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn to_owo(self) -> owo_colors::Style; -} +//! Convert between [owo-colors](https://lib.rs/owo-colors) and generic styling types -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn to_owo(self) -> owo_colors::Style { - to_owo_style(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Adapt generic styling to [`owo_colors`] pub fn to_owo_style(style: anstyle::Style) -> owo_colors::Style { let fg = style.get_fg_color().map(to_owo_colors); let bg = style.get_bg_color().map(to_owo_colors); @@ -53,6 +45,7 @@ pub fn to_owo_style(style: anstyle::Style) -> owo_colors::Style { style } +/// Adapt generic colors to [`owo_colors`] pub fn to_owo_colors(color: anstyle::Color) -> owo_colors::DynColors { match color { anstyle::Color::Ansi(ansi) => owo_colors::DynColors::Ansi(ansi_to_owo_colors_color(ansi)), diff --git a/crates/anstyle-parse/CHANGELOG.md b/crates/anstyle-parse/CHANGELOG.md index 1491e74a..8f5958a2 100644 --- a/crates/anstyle-parse/CHANGELOG.md +++ b/crates/anstyle-parse/CHANGELOG.md @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [0.2.6] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [0.2.5] - 2024-07-25 + +## [0.2.4] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [0.2.3] - 2023-12-04 + ## [0.2.2] - 2023-09-28 ### Compatibility @@ -28,7 +44,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.0.1] - 2023-03-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.2...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.6...HEAD +[0.2.6]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.5...anstyle-parse-v0.2.6 +[0.2.5]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.4...anstyle-parse-v0.2.5 +[0.2.4]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.3...anstyle-parse-v0.2.4 +[0.2.3]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.2...anstyle-parse-v0.2.3 [0.2.2]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.1...anstyle-parse-v0.2.2 [0.2.1]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.2.0...anstyle-parse-v0.2.1 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-parse-v0.1.1...anstyle-parse-v0.2.0 diff --git a/crates/anstyle-parse/Cargo.toml b/crates/anstyle-parse/Cargo.toml index b436c3d7..6f705752 100644 --- a/crates/anstyle-parse/Cargo.toml +++ b/crates/anstyle-parse/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.6" description = "Parse ANSI Style Escapes" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "vte"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -30,12 +34,16 @@ core = ["dep:arrayvec"] utf8 = ["dep:utf8parse"] [dev-dependencies] -codegenrs = { version = "2.0.0", default-features = false } -criterion = "0.5.1" -proptest = "1.2.0" -snapbox = { version = "0.4.12", features = ["path"] } +codegenrs = { version = "3.0.1", default-features = false } +divan = "0.1.14" +proptest = "1.4.0" +snapbox = "0.6.5" vte_generate_state_changes = { version = "0.1.1" } [[bench]] name = "parse" harness = false +required-features = ["utf8"] + +[lints] +workspace = true diff --git a/crates/anstyle-parse/benches/parse.rs b/crates/anstyle-parse/benches/parse.rs index aff8cbbf..4cfe9363 100644 --- a/crates/anstyle-parse/benches/parse.rs +++ b/crates/anstyle-parse/benches/parse.rs @@ -1,6 +1,56 @@ -use criterion::{black_box, Criterion}; +#![allow(clippy::incompatible_msrv)] // not verifying benches atm -use anstyle_parse::*; +use std::hint::black_box; + +use anstyle_parse::DefaultCharAccumulator; +use anstyle_parse::Params; +use anstyle_parse::Parser; +use anstyle_parse::Perform; + +#[divan::bench(args = DATA)] +fn advance(data: &Data) { + let mut dispatcher = BenchDispatcher; + let mut parser = Parser::::new(); + + for byte in data.content() { + parser.advance(&mut dispatcher, *byte); + } +} + +#[divan::bench(args = DATA)] +fn advance_strip(data: &Data) -> String { + let mut stripped = Strip::with_capacity(data.content().len()); + let mut parser = Parser::::new(); + + for byte in data.content() { + parser.advance(&mut stripped, *byte); + } + + black_box(stripped.0) +} + +#[divan::bench(args = DATA)] +fn state_change(data: &Data) { + let mut state = anstyle_parse::state::State::default(); + for byte in data.content() { + let (next_state, action) = anstyle_parse::state::state_change(state, *byte); + state = next_state; + black_box(action); + } +} + +#[divan::bench(args = DATA)] +fn state_change_strip_str(bencher: divan::Bencher<'_, '_>, data: &Data) { + if let Ok(content) = std::str::from_utf8(data.content()) { + bencher + .with_inputs(|| content) + .bench_local_values(|content| { + let stripped = strip_str(content); + + black_box(stripped) + }); + } +} struct BenchDispatcher; impl Perform for BenchDispatcher { @@ -96,20 +146,50 @@ fn strip_str(content: &str) -> String { bytes = next; } + #[allow(clippy::unwrap_used)] String::from_utf8(stripped).unwrap() } -fn parse(c: &mut Criterion) { - for (name, content) in [ - #[cfg(feature = "utf8")] - ("demo.vte", &include_bytes!("../tests/demo.vte")[..]), - ("rg_help.vte", &include_bytes!("../tests/rg_help.vte")[..]), - ("rg_linus.vte", &include_bytes!("../tests/rg_linus.vte")[..]), - ( - "state_changes", - &b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\"[..], - ), - ] { +const DATA: &[Data] = &[ + Data( + "0-state_changes", + b"\x1b]2;X\x1b\\ \x1b[0m \x1bP0@\x1b\\".as_slice(), + ), + #[cfg(feature = "utf8")] + Data("1-demo.vte", include_bytes!("../tests/demo.vte").as_slice()), + Data( + "2-rg_help.vte", + include_bytes!("../tests/rg_help.vte").as_slice(), + ), + Data( + "3-rg_linus.vte", + include_bytes!("../tests/rg_linus.vte").as_slice(), + ), +]; + +#[derive(Debug)] +struct Data(&'static str, &'static [u8]); + +impl Data { + const fn name(&self) -> &'static str { + self.0 + } + + const fn content(&self) -> &'static [u8] { + self.1 + } +} + +impl std::fmt::Display for Data { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.name().fmt(f) + } +} + +#[test] +fn verify_data() { + for data in DATA { + let Data(name, content) = data; // Make sure the comparison is fair if let Ok(content) = std::str::from_utf8(content) { let mut stripped = Strip::with_capacity(content.len()); @@ -119,51 +199,9 @@ fn parse(c: &mut Criterion) { } assert_eq!(stripped.0, strip_str(content)); } - - let mut group = c.benchmark_group(name); - group.bench_function("advance", |b| { - b.iter(|| { - let mut dispatcher = BenchDispatcher; - let mut parser = Parser::::new(); - - for byte in content { - parser.advance(&mut dispatcher, *byte); - } - }) - }); - group.bench_function("advance_strip", |b| { - b.iter(|| { - let mut stripped = Strip::with_capacity(content.len()); - let mut parser = Parser::::new(); - - for byte in content { - parser.advance(&mut stripped, *byte); - } - - black_box(stripped.0) - }) - }); - group.bench_function("state_change", |b| { - b.iter(|| { - let mut state = anstyle_parse::state::State::default(); - for byte in content { - let (next_state, action) = anstyle_parse::state::state_change(state, *byte); - state = next_state; - black_box(action); - } - }) - }); - if let Ok(content) = std::str::from_utf8(content) { - group.bench_function("state_change_strip_str", |b| { - b.iter(|| { - let stripped = strip_str(content); - - black_box(stripped) - }) - }); - } } } -criterion::criterion_group!(benches, parse); -criterion::criterion_main!(benches); +fn main() { + divan::main(); +} diff --git a/crates/anstyle-parse/examples/parselog.rs b/crates/anstyle-parse/examples/parselog.rs index ed89650d..22b1711b 100644 --- a/crates/anstyle-parse/examples/parselog.rs +++ b/crates/anstyle-parse/examples/parselog.rs @@ -8,22 +8,21 @@ struct Log; impl Perform for Log { fn print(&mut self, c: char) { - println!("[print] {:?}", c); + println!("[print] {c:?}"); } fn execute(&mut self, byte: u8) { - println!("[execute] {:02x}", byte); + println!("[execute] {byte:02x}"); } fn hook(&mut self, params: &Params, intermediates: &[u8], ignore: bool, c: u8) { println!( - "[hook] params={:?}, intermediates={:?}, ignore={:?}, char={:?}", - params, intermediates, ignore, c + "[hook] params={params:?}, intermediates={intermediates:?}, ignore={ignore:?}, char={c:?}" ); } fn put(&mut self, byte: u8) { - println!("[put] {:02x}", byte); + println!("[put] {byte:02x}"); } fn unhook(&mut self) { @@ -31,23 +30,18 @@ impl Perform for Log { } fn osc_dispatch(&mut self, params: &[&[u8]], bell_terminated: bool) { - println!( - "[osc_dispatch] params={:?} bell_terminated={}", - params, bell_terminated - ); + println!("[osc_dispatch] params={params:?} bell_terminated={bell_terminated}"); } fn csi_dispatch(&mut self, params: &Params, intermediates: &[u8], ignore: bool, c: u8) { println!( - "[csi_dispatch] params={:#?}, intermediates={:?}, ignore={:?}, char={:?}", - params, intermediates, ignore, c + "[csi_dispatch] params={params:#?}, intermediates={intermediates:?}, ignore={ignore:?}, char={c:?}" ); } fn esc_dispatch(&mut self, intermediates: &[u8], ignore: bool, byte: u8) { println!( - "[esc_dispatch] intermediates={:?}, ignore={:?}, byte={:02x}", - intermediates, ignore, byte + "[esc_dispatch] intermediates={intermediates:?}, ignore={ignore:?}, byte={byte:02x}" ); } } @@ -70,7 +64,7 @@ fn main() { } } Err(err) => { - println!("err: {}", err); + println!("err: {err}"); break; } } diff --git a/crates/anstyle-parse/src/lib.rs b/crates/anstyle-parse/src/lib.rs index e3d04c9a..117a1842 100644 --- a/crates/anstyle-parse/src/lib.rs +++ b/crates/anstyle-parse/src/lib.rs @@ -29,6 +29,10 @@ //! //! [Paul Williams' ANSI parser state machine]: https://vt100.net/emu/dec_ansi_parser #![cfg_attr(not(test), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![allow(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] #[cfg(not(feature = "core"))] extern crate alloc; @@ -53,6 +57,7 @@ const MAX_OSC_PARAMS: usize = 16; const MAX_OSC_RAW: usize = 1024; /// Parser for raw _VTE_ protocol which delegates actions to a [`Perform`] +#[allow(unused_qualifications)] #[derive(Default, Clone, Debug, PartialEq, Eq)] pub struct Parser { state: State, @@ -162,9 +167,9 @@ where } } - /// Separate method for osc_dispatch that borrows self as read-only + /// Separate method for `osc_dispatch` that borrows self as read-only /// - /// The aliasing is needed here for multiple slices into self.osc_raw + /// The aliasing is needed here for multiple slices into `self.osc_raw` #[inline] fn osc_dispatch(&self, performer: &mut P, byte: u8) { let mut slices: [MaybeUninit<&[u8]>; MAX_OSC_PARAMS] = @@ -322,12 +327,14 @@ pub trait CharAccumulator: Default { fn add(&mut self, byte: u8) -> Option; } +/// Most flexible [`CharAccumulator`] for [`Parser`] based on active features #[cfg(feature = "utf8")] pub type DefaultCharAccumulator = Utf8Parser; #[cfg(not(feature = "utf8"))] pub type DefaultCharAccumulator = AsciiParser; /// Only allow parsing 7-bit ASCII +#[allow(clippy::exhaustive_structs)] #[derive(Default, Clone, Debug, PartialEq, Eq)] pub struct AsciiParser; diff --git a/crates/anstyle-parse/src/state/codegen.rs b/crates/anstyle-parse/src/state/codegen.rs index 226c2d40..60aae35d 100644 --- a/crates/anstyle-parse/src/state/codegen.rs +++ b/crates/anstyle-parse/src/state/codegen.rs @@ -1,5 +1,6 @@ use super::{pack, unpack, Action, State}; +use snapbox::file; use vte_generate_state_changes::generate_state_changes; #[test] @@ -9,7 +10,7 @@ fn table() { let content = String::from_utf8(content).unwrap(); let content = codegenrs::rustfmt(&content, None).unwrap(); - snapbox::assert_eq_path("./src/state/table.rs", content); + snapbox::assert_data_eq!(content, file!["table.rs"].raw()); } #[allow(clippy::write_literal)] @@ -17,7 +18,7 @@ fn generate_table(file: &mut impl std::io::Write) -> std::io::Result<()> { writeln!( file, "// This file is @generated by {}", - file!().replace('\\', "/") + std::file!().replace('\\', "/") )?; writeln!(file)?; writeln!( @@ -35,10 +36,10 @@ pub(crate) const STATE_CHANGES: [[u8; 256]; 16] = ["# let (next_state, action) = unpack(*packed); if last_entry != Some(packed) { writeln!(file)?; - writeln!(file, " // {:?} {:?}", next_state, action)?; + writeln!(file, " // {next_state:?} {action:?}")?; write!(file, " ")?; } - write!(file, "0x{:0>2x}, ", packed)?; + write!(file, "0x{packed:0>2x}, ")?; last_entry = Some(packed); } writeln!(file)?; @@ -51,7 +52,7 @@ pub(crate) const STATE_CHANGES: [[u8; 256]; 16] = ["# /// This is the state change table. It's indexed first by current state and then by the next /// character in the pty stream. -pub static STATE_CHANGES: [[u8; 256]; 16] = state_changes(); +pub(crate) static STATE_CHANGES: [[u8; 256]; 16] = state_changes(); generate_state_changes!(state_changes, { Anywhere { 0x18 => (Ground, Execute), diff --git a/crates/anstyle-parse/src/state/definitions.rs b/crates/anstyle-parse/src/state/definitions.rs index c4e76735..a7620f33 100644 --- a/crates/anstyle-parse/src/state/definitions.rs +++ b/crates/anstyle-parse/src/state/definitions.rs @@ -1,3 +1,5 @@ +#![allow(clippy::exhaustive_enums)] + use core::mem; #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -110,20 +112,20 @@ const ACTIONS: [Action; 16] = [ /// /// Bad things will happen if those invariants are violated. #[inline(always)] -pub const fn unpack(delta: u8) -> (State, Action) { +pub(crate) const fn unpack(delta: u8) -> (State, Action) { unsafe { ( // State is stored in bottom 4 bits - mem::transmute(delta & 0x0f), + mem::transmute::(delta & 0x0f), // Action is stored in top 4 bits - mem::transmute(delta >> 4), + mem::transmute::(delta >> 4), ) } } #[inline(always)] #[cfg(test)] -pub const fn pack(state: State, action: Action) -> u8 { +pub(crate) const fn pack(state: State, action: Action) -> u8 { (action as u8) << 4 | state as u8 } diff --git a/crates/anstyle-parse/src/state/mod.rs b/crates/anstyle-parse/src/state/mod.rs index 91942059..a1d86918 100644 --- a/crates/anstyle-parse/src/state/mod.rs +++ b/crates/anstyle-parse/src/state/mod.rs @@ -1,3 +1,5 @@ +//! ANSI escape code parsing state machine + #[cfg(test)] mod codegen; mod definitions; diff --git a/crates/anstyle-parse/tests/testsuite.rs b/crates/anstyle-parse/tests/testsuite.rs index 53b27c0e..2aa63a0d 100644 --- a/crates/anstyle-parse/tests/testsuite.rs +++ b/crates/anstyle-parse/tests/testsuite.rs @@ -244,7 +244,7 @@ advance!( fn gen_exceed_max_buffer_size() -> (Vec, Dispatcher) { static NUM_BYTES: usize = MAX_OSC_RAW + 100; static INPUT_START: &[u8] = &[0x1b, b']', b'5', b'2', b';', b's']; - static INPUT_END: &[u8] = &[b'\x07']; + static INPUT_END: &[u8] = b"\x07"; let mut input = INPUT_START.to_vec(); input.resize(INPUT_START.len() + NUM_BYTES, b'a'); input.extend(INPUT_END); diff --git a/crates/anstyle-query/CHANGELOG.md b/crates/anstyle-query/CHANGELOG.md index 9e1c2dfd..057be102 100644 --- a/crates/anstyle-query/CHANGELOG.md +++ b/crates/anstyle-query/CHANGELOG.md @@ -7,6 +7,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.1.2] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [1.1.1] - 2024-07-25 + +## [1.1.0] - 2024-06-04 + +### Fixes + +- `CLICOLOR_FORCE` now only checks for non-empty strings, rather than non-`"0"` strings + +## [1.0.3] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [1.0.2] - 2023-12-08 + +### Features + +- Expose `windows::enable_virtual_terminal_processing` + +## [1.0.1] - 2023-12-04 + ### Compatibility - Update MSRV to 1.70.0 @@ -14,5 +42,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [1.0.0] - 2023-04-13 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.1.2...HEAD +[1.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.1.1...anstyle-query-v1.1.2 +[1.1.1]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.1.0...anstyle-query-v1.1.1 +[1.1.0]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.0.3...anstyle-query-v1.1.0 +[1.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.0.2...anstyle-query-v1.0.3 +[1.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.0.1...anstyle-query-v1.0.2 +[1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-query-v1.0.0...anstyle-query-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/c4423c1...anstyle-query-v1.0.0 diff --git a/crates/anstyle-query/Cargo.toml b/crates/anstyle-query/Cargo.toml index c1399ba8..12c29364 100644 --- a/crates/anstyle-query/Cargo.toml +++ b/crates/anstyle-query/Cargo.toml @@ -1,15 +1,19 @@ [package] name = "anstyle-query" -version = "1.0.0" +version = "1.1.2" description = "Look up colored console capabilities" -repository = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["cli", "color", "no-std", "terminal", "ansi"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,4 +24,7 @@ pre-release-replacements = [ ] [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.48.0", features = ["Win32_System_Console", "Win32_Foundation"] } +windows-sys = { version = "0.59.0", features = ["Win32_System_Console", "Win32_Foundation"] } + +[lints] +workspace = true diff --git a/crates/anstyle-query/examples/report.rs b/crates/anstyle-query/examples/query.rs similarity index 75% rename from crates/anstyle-query/examples/report.rs rename to crates/anstyle-query/examples/query.rs index 32281147..e5d66205 100644 --- a/crates/anstyle-query/examples/report.rs +++ b/crates/anstyle-query/examples/query.rs @@ -1,3 +1,5 @@ +//! Report a terminal's capabilities + fn main() { println!("clicolor: {:?}", anstyle_query::clicolor()); println!("clicolor_force: {}", anstyle_query::clicolor_force()); @@ -15,5 +17,10 @@ fn main() { "enable_ansi_colors: {:?}", anstyle_query::windows::enable_ansi_colors() ); + #[cfg(windows)] + println!( + " enable_virtual_terminal_processing: {:?}", + anstyle_query::windows::enable_virtual_terminal_processing() + ); println!("is_ci: {:?}", anstyle_query::is_ci()); } diff --git a/crates/anstyle-query/src/lib.rs b/crates/anstyle-query/src/lib.rs index 4b3745a5..64ae7942 100644 --- a/crates/anstyle-query/src/lib.rs +++ b/crates/anstyle-query/src/lib.rs @@ -1,3 +1,10 @@ +//! Low level terminal capability lookups + +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] + pub mod windows; /// Check [CLICOLOR] status @@ -25,11 +32,7 @@ pub fn clicolor() -> Option { /// [CLICOLOR_FORCE]: https://bixense.com/clicolors/ #[inline] pub fn clicolor_force() -> bool { - let value = std::env::var_os("CLICOLOR_FORCE"); - value - .as_deref() - .unwrap_or_else(|| std::ffi::OsStr::new("0")) - != "0" + non_empty(std::env::var_os("CLICOLOR_FORCE").as_deref()) } /// Check [NO_COLOR] status @@ -44,67 +47,65 @@ pub fn clicolor_force() -> bool { /// [NO_COLOR]: https://no-color.org/ #[inline] pub fn no_color() -> bool { - let value = std::env::var_os("NO_COLOR"); - value.as_deref().unwrap_or_else(|| std::ffi::OsStr::new("")) != "" + non_empty(std::env::var_os("NO_COLOR").as_deref()) } /// Check `TERM` for color support #[inline] -#[cfg(not(windows))] pub fn term_supports_color() -> bool { - match std::env::var_os("TERM") { - // If TERM isn't set, then we are in a weird environment that - // probably doesn't support colors. - None => return false, - Some(k) => { - if k == "dumb" { - return false; + #[cfg(not(windows))] + { + match std::env::var_os("TERM") { + // If TERM isn't set, then we are in a weird environment that + // probably doesn't support colors. + None => return false, + Some(k) => { + if k == "dumb" { + return false; + } } } + true } - true -} - -/// Check `TERM` for color support -#[inline] -#[cfg(windows)] -pub fn term_supports_color() -> bool { - // On Windows, if TERM isn't set, then we shouldn't automatically - // assume that colors aren't allowed. This is unlike Unix environments - // where TERM is more rigorously set. - if let Some(k) = std::env::var_os("TERM") { - if k == "dumb" { - return false; + #[cfg(windows)] + { + // On Windows, if TERM isn't set, then we shouldn't automatically + // assume that colors aren't allowed. This is unlike Unix environments + // where TERM is more rigorously set. + if let Some(k) = std::env::var_os("TERM") { + if k == "dumb" { + return false; + } } + true } - true -} - -/// Check `TERM` for ANSI color support -#[inline] -#[cfg(not(windows))] -pub fn term_supports_ansi_color() -> bool { - term_supports_color() } /// Check `TERM` for ANSI color support +/// +/// On Windows, you might need to also check [`windows::enable_ansi_colors`] as ANSI color support +/// is opt-in, rather than assumed. #[inline] -#[cfg(windows)] pub fn term_supports_ansi_color() -> bool { - match std::env::var_os("TERM") { - // If TERM isn't set, then we are in a weird environment that - // probably doesn't support ansi. - None => return false, - Some(k) => { - // cygwin doesn't seem to support ANSI escape sequences - // and instead has its own variety. However, the Windows - // console API may be available. - if k == "dumb" || k == "cygwin" { - return false; + #[cfg(not(windows))] + { + term_supports_color() + } + #[cfg(windows)] + { + match std::env::var_os("TERM") { + None => return false, + Some(k) => { + // cygwin doesn't seem to support ANSI escape sequences + // and instead has its own variety. However, the Windows + // console API may be available. + if k == "dumb" || k == "cygwin" { + return false; + } } } + true } - true } /// Check [COLORTERM] for truecolor support @@ -132,3 +133,27 @@ pub fn is_ci() -> bool { // - Woodpecker sets it to `woodpecker` std::env::var_os("CI").is_some() } + +fn non_empty(var: Option<&std::ffi::OsStr>) -> bool { + !var.unwrap_or_default().is_empty() +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn non_empty_not_present() { + assert!(!non_empty(None)); + } + + #[test] + fn non_empty_empty() { + assert!(!non_empty(Some(std::ffi::OsStr::new("")))); + } + + #[test] + fn non_empty_texty() { + assert!(non_empty(Some(std::ffi::OsStr::new("hello")))); + } +} diff --git a/crates/anstyle-query/src/windows.rs b/crates/anstyle-query/src/windows.rs index ea3e981d..4ac18965 100644 --- a/crates/anstyle-query/src/windows.rs +++ b/crates/anstyle-query/src/windows.rs @@ -1,15 +1,18 @@ +//! Windows-specific style queries + #[cfg(windows)] mod windows_console { use std::os::windows::io::AsRawHandle; use std::os::windows::io::RawHandle; + use windows_sys::Win32::Foundation::HANDLE; use windows_sys::Win32::System::Console::CONSOLE_MODE; use windows_sys::Win32::System::Console::ENABLE_VIRTUAL_TERMINAL_PROCESSING; fn enable_vt(handle: RawHandle) -> std::io::Result<()> { unsafe { - let handle = std::mem::transmute(handle); - if handle == 0 { + let handle: HANDLE = std::mem::transmute(handle); + if handle.is_null() { return Err(std::io::Error::new( std::io::ErrorKind::BrokenPipe, "console is detached", @@ -30,7 +33,7 @@ mod windows_console { } } - fn enable_ansi_colors_raw() -> std::io::Result<()> { + pub fn enable_virtual_terminal_processing() -> std::io::Result<()> { let stdout = std::io::stdout(); let stdout_handle = stdout.as_raw_handle(); let stderr = std::io::stderr(); @@ -45,17 +48,32 @@ mod windows_console { } #[inline] - pub fn enable_ansi_colors() -> Option { - Some(enable_ansi_colors_raw().map(|_| true).unwrap_or(false)) + pub(crate) fn enable_ansi_colors() -> Option { + Some( + enable_virtual_terminal_processing() + .map(|_| true) + .unwrap_or(false), + ) } } #[cfg(not(windows))] mod windows_console { #[inline] - pub fn enable_ansi_colors() -> Option { + pub(crate) fn enable_ansi_colors() -> Option { None } } -pub use self::windows_console::enable_ansi_colors; +/// Enable ANSI escape codes ([`ENABLE_VIRTUAL_TERMINAL_PROCESSING`](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences)) +/// +/// For non-windows systems, returns `None` +pub fn enable_ansi_colors() -> Option { + windows_console::enable_ansi_colors() +} + +/// Raw ENABLE_VIRTUAL_TERMINAL_PROCESSING on stdout/stderr +#[cfg(windows)] +pub fn enable_virtual_terminal_processing() -> std::io::Result<()> { + windows_console::enable_virtual_terminal_processing() +} diff --git a/crates/anstyle-roff/CHANGELOG.md b/crates/anstyle-roff/CHANGELOG.md index fae4d931..6e1e9b7d 100644 --- a/crates/anstyle-roff/CHANGELOG.md +++ b/crates/anstyle-roff/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [0.3.5] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [0.3.4] - 2024-07-25 + +## [0.3.3] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + ## [0.3.2] - 2023-09-28 ### Compatibility @@ -30,7 +44,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.0] - 2023-02-10 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.2...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.5...HEAD +[0.3.5]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.4...anstyle-roff-v0.3.5 +[0.3.4]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.3...anstyle-roff-v0.3.4 +[0.3.3]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.2...anstyle-roff-v0.3.3 [0.3.2]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.1...anstyle-roff-v0.3.2 [0.3.1]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.3.0...anstyle-roff-v0.3.1 [0.3.0]: https://github.com/rust-cli/anstyle/compare/anstyle-roff-v0.2.0...anstyle-roff-v0.3.0 diff --git a/crates/anstyle-roff/Cargo.toml b/crates/anstyle-roff/Cargo.toml index 9762a8b3..d38ca664 100644 --- a/crates/anstyle-roff/Cargo.toml +++ b/crates/anstyle-roff/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-roff" -version = "0.3.2" +version = "0.3.5" description = "Adapt between anstyle and roff" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "roff"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -27,4 +31,7 @@ roff = "0.2.1" cansi = "2.2.1" [dev-dependencies] -snapbox = "0.4.12" +snapbox = "0.6.5" + +[lints] +workspace = true diff --git a/crates/anstyle-roff/src/lib.rs b/crates/anstyle-roff/src/lib.rs index 4ca1f049..a111b308 100644 --- a/crates/anstyle-roff/src/lib.rs +++ b/crates/anstyle-roff/src/lib.rs @@ -2,6 +2,11 @@ //! Currently uses [roff](https://docs.rs/roff/0.2.1/roff/) as the engine for generating //! roff output. +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] + mod styled_str; use anstyle::{Ansi256Color, AnsiColor, Color, RgbColor, Style}; use anstyle_lossy::palette::Palette; @@ -11,14 +16,14 @@ use styled_str::StyledStr; /// Static Strings defining ROFF Control Requests mod control_requests { /// Control to Create a Color definition - pub const CREATE_COLOR: &str = "defcolor"; + pub(crate) const CREATE_COLOR: &str = "defcolor"; /// Roff control request to set background color (fill color) - pub const BACKGROUND: &str = "fcolor"; + pub(crate) const BACKGROUND: &str = "fcolor"; /// Roff control request to set foreground color (glyph color) - pub const FOREGROUND: &str = "gcolor"; + pub(crate) const FOREGROUND: &str = "gcolor"; } -/// Generate A RoffStyle from Style +/// Generate a [`Roff`] from ANSI escape codes /// /// ```rust /// let text = "\u{1b}[44;31mtest\u{1b}[0m"; @@ -43,7 +48,7 @@ pub fn to_roff(styled_text: &str) -> Roff { doc } -fn set_effects_and_text(styled: &StyledStr, doc: &mut Roff) { +fn set_effects_and_text(styled: &StyledStr<'_>, doc: &mut Roff) { // Roff (the crate) only supports these inline commands // - Bold // - Italic @@ -69,7 +74,7 @@ fn has_bright_fg(style: &Style) -> bool { .unwrap_or(false) } -/// Check if Color is an AnsiColor::Bright* variant +/// Check if [`Color`] is an [`AnsiColor::Bright*`][AnsiColor] variant fn is_bright(fg_color: &Color) -> bool { if let Color::Ansi(color) = fg_color { matches!( @@ -90,7 +95,7 @@ fn is_bright(fg_color: &Color) -> bool { type ColorSet<'a> = (&'a Option, &'a Option); -fn set_color(colors: ColorSet, doc: &mut Roff) { +fn set_color(colors: ColorSet<'_>, doc: &mut Roff) { add_color_to_roff(doc, control_requests::FOREGROUND, colors.0); add_color_to_roff(doc, control_requests::BACKGROUND, colors.1); } @@ -116,7 +121,7 @@ fn add_color_to_roff(doc: &mut Roff, control_request: &str, color: &Option { // TODO: get rid of "default" hardcoded str? @@ -139,11 +144,11 @@ fn rgb_name(c: &RgbColor) -> String { fn to_hex(rgb: &RgbColor) -> String { let val: usize = ((rgb.0 as usize) << 16) + ((rgb.1 as usize) << 8) + (rgb.2 as usize); - format!("#{:06x}", val) + format!("#{val:06x}") } /// Map Color and Bright Variants to Roff Color styles -fn ansi_color_to_roff(color: &anstyle::AnsiColor) -> &'static str { +fn ansi_color_to_roff(color: &AnsiColor) -> &'static str { match color { AnsiColor::Black | AnsiColor::BrightBlack => "black", AnsiColor::Red | AnsiColor::BrightRed => "red", diff --git a/crates/anstyle-roff/src/styled_str.rs b/crates/anstyle-roff/src/styled_str.rs index 59ffb67e..cf5030d8 100644 --- a/crates/anstyle-roff/src/styled_str.rs +++ b/crates/anstyle-roff/src/styled_str.rs @@ -3,8 +3,8 @@ use anstyle::{AnsiColor, Color as AColor, Effects, Style}; use cansi::{v3::CategorisedSlice, Color, Intensity}; -/// Produce a stream of StyledStr from text that contains ansi escape sequences -pub(crate) fn styled_stream(text: &str) -> impl Iterator { +/// Produce a stream of [`StyledStr`] from text that contains ansi escape sequences +pub(crate) fn styled_stream(text: &str) -> impl Iterator> { let categorized = cansi::v3::categorise_text(text); categorized.into_iter().map(|x| x.into()) } @@ -12,8 +12,8 @@ pub(crate) fn styled_stream(text: &str) -> impl Iterator { /// Represents a Section of text, along with the desired styling for it #[derive(Debug, Default, Clone, Copy)] pub(crate) struct StyledStr<'text> { - pub text: &'text str, - pub style: Style, + pub(crate) text: &'text str, + pub(crate) style: Style, } impl<'text> From> for StyledStr<'text> { @@ -33,7 +33,7 @@ impl<'text> From> for StyledStr<'text> { } } -fn create_effects(category: &CategorisedSlice) -> Effects { +fn create_effects(category: &CategorisedSlice<'_>) -> Effects { Effects::new() .set(Effects::ITALIC, category.italic.unwrap_or(false)) .set(Effects::BLINK, category.blink.unwrap_or(false)) @@ -83,14 +83,16 @@ mod tests { use super::*; - /// Creates a CategorisedSlice for Testing + /// Creates a [`CategorisedSlice`] for Testing /// - /// styled_str!( Text, [Color:COLOR_SET] [Intensity:INTENSITY_SET] [Effects:EFFECTS_SET]) + /// ```rust + /// styled_str!(Text, [Color:COLOR_SET] [Intensity:INTENSITY_SET] [Effects:EFFECTS_SET]) + /// ``` /// /// Where: - /// COLOR_SET={fg|bg}: - /// INTENSITY_SET= - /// EFFECTS_SET = {"underline"|"italic"|"blink"|"reversed"|"strikethrough"|"hidden"};+ + /// `COLOR_SET={fg|bg}:` + /// `INTENSITY_SET=` + /// `EFFECTS_SET={"underline"|"italic"|"blink"|"reversed"|"strikethrough"|"hidden"};+` macro_rules! styled_str { ($text: literal, $(Color:$color_key:literal:$color_val:expr;)* $(Intensity:$intensity:expr;)? $(Effects:$($key:literal;)+)? ) => { { @@ -137,14 +139,14 @@ mod tests { #[test] fn from_categorized_underlined() { let categorised = styled_str!("Hello", Effects:"underline";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::UNDERLINE)); } #[test] fn from_categorized_underlined_striketrhough() { let categorised = styled_str!("Hello", Effects:"underline";"strikethrough";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::UNDERLINE)); assert!(styled_str .style @@ -155,21 +157,21 @@ mod tests { #[test] fn from_categorized_blink() { let categorised = styled_str!("Hello", Effects:"blink";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::BLINK)); } #[test] fn from_categorized_reversed() { let categorised = styled_str!("Hello", Effects:"reversed";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::INVERT)); } #[test] fn from_categorized_strikthrough() { let categorised = styled_str!("Hello", Effects:"strikethrough";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str .style .get_effects() @@ -179,14 +181,14 @@ mod tests { #[test] fn from_categorized_hidden() { let categorised = styled_str!("Hello", Effects:"hidden";); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::HIDDEN)); } #[test] fn from_categorized_bg() { let categorised = styled_str!("Hello", Color:"bg":Color::Blue;); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(matches!( styled_str.style.get_bg_color(), Some(AColor::Ansi(AnsiColor::Blue)) @@ -196,7 +198,7 @@ mod tests { #[test] fn from_categorized_fg() { let categorised = styled_str!("Hello", Color:"fg":Color::Blue;); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(matches!( styled_str.style.get_fg_color(), Some(AColor::Ansi(AnsiColor::Blue)) @@ -206,14 +208,14 @@ mod tests { #[test] fn from_categorized_bold() { let categorised = styled_str!("Hello", Intensity:Intensity::Bold;); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::BOLD)); } #[test] fn from_categorized_faint() { let categorised = styled_str!("Hello", Intensity:Intensity::Faint;); - let styled_str: StyledStr = categorised.into(); + let styled_str: StyledStr<'_> = categorised.into(); assert!(styled_str.style.get_effects().contains(Effects::DIMMED)); } } diff --git a/crates/anstyle-roff/tests/test_roff.rs b/crates/anstyle-roff/tests/test_roff.rs index a2b919e8..0544b8d0 100644 --- a/crates/anstyle-roff/tests/test_roff.rs +++ b/crates/anstyle-roff/tests/test_roff.rs @@ -1,4 +1,6 @@ use anstyle::Style; +use snapbox::assert_data_eq; +use snapbox::file; #[test] fn test_ansi_color_output() { @@ -7,7 +9,7 @@ fn test_ansi_color_output() { // let text = format!("{}{}", style.render(), "test"); let text = "\u{1b}[31;44mtest".to_owned(); let roff_doc = anstyle_roff::to_roff(&text); - snapbox::assert_eq_path("tests/roffs/ansi_color.roff", roff_doc.to_roff()); + assert_data_eq!(roff_doc.to_roff(), file!["roffs/ansi_color.roff"].raw()); } #[test] @@ -17,7 +19,7 @@ fn test_bold_output() { dbg!(&text); let roff_doc = anstyle_roff::to_roff(&text); - snapbox::assert_eq_path("tests/roffs/bold.roff", roff_doc.to_roff()); + assert_data_eq!(roff_doc.to_roff(), file!["roffs/bold.roff"].raw()); } #[test] @@ -27,7 +29,7 @@ fn test_italic_output() { dbg!(&text); let roff_doc = anstyle_roff::to_roff(&text); - snapbox::assert_eq_path("tests/roffs/italic.roff", roff_doc.to_roff()); + assert_data_eq!(roff_doc.to_roff(), file!["roffs/italic.roff"].raw()); } #[test] @@ -38,5 +40,8 @@ fn test_bright_color_output_as_bold() { let text = "\u{1b}[91;44mtest".to_owned(); dbg!(&text); let roff_doc = anstyle_roff::to_roff(&text); - snapbox::assert_eq_path("tests/roffs/bright_ansi_colors.roff", roff_doc.to_roff()); + assert_data_eq!( + roff_doc.to_roff(), + file!["roffs/bright_ansi_colors.roff"].raw() + ); } diff --git a/crates/anstyle-svg/CHANGELOG.md b/crates/anstyle-svg/CHANGELOG.md new file mode 100644 index 00000000..9bb502f1 --- /dev/null +++ b/crates/anstyle-svg/CHANGELOG.md @@ -0,0 +1,63 @@ +# Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + +## [Unreleased] - ReleaseDate + +## [0.1.7] - 2024-10-24 + +## [0.1.6] - 2024-10-10 + +### Internal + +- Update `unicode-width` to 0.2 + +### Compatibility + +- Update MSRV to 1.66 + +## [0.1.5] - 2024-07-25 + +## [0.1.4] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [0.1.3] - 2024-02-22 + +### Fixes + +- Reduce noise in SVG + +## [0.1.2] - 2024-02-20 + +### Fixes + +- Ensure each section has a blank line inbetween +- Add configurable padding +- Allow setting min width +- Use round numbers for width + +## [0.1.1] - 2024-02-18 + +### Documentation + +- Specify what the API does + +## [0.1.0] - 2024-02-18 + + +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.7...HEAD +[0.1.7]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.6...anstyle-svg-v0.1.7 +[0.1.6]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.5...anstyle-svg-v0.1.6 +[0.1.5]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.4...anstyle-svg-v0.1.5 +[0.1.4]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.3...anstyle-svg-v0.1.4 +[0.1.3]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.2...anstyle-svg-v0.1.3 +[0.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.1...anstyle-svg-v0.1.2 +[0.1.1]: https://github.com/rust-cli/anstyle/compare/anstyle-svg-v0.1.0...anstyle-svg-v0.1.1 +[0.1.0]: https://github.com/rust-cli/anstyle/compare/f6784b0002e4fbd4c3532dc66aad8b86fc3c7748...anstyle-svg-v0.1.0 + diff --git a/crates/anstyle-svg/Cargo.toml b/crates/anstyle-svg/Cargo.toml new file mode 100644 index 00000000..3d7e5a01 --- /dev/null +++ b/crates/anstyle-svg/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "anstyle-svg" +version = "0.1.7" +description = "Convert ANSI escape codes to SVG" +homepage = "https://github.com/rust-cli/anstyle" +categories = ["command-line-interface"] +keywords = ["ansi", "terminal", "color", "svg"] +repository.workspace = true +license.workspace = true +edition.workspace = true +rust-version.workspace = true +include.workspace = true + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[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/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, +] + +[dependencies] +anstyle = { version = "1.0.0", path = "../anstyle" } +anstream = { version = "0.6", path = "../anstream", default-features = false } +anstyle-lossy = { version = "1.0.0", path = "../anstyle-lossy" } +html-escape = "0.2.13" +unicode-width = "0.2.0" + +[dev-dependencies] +snapbox = "0.6.5" + +[lints] +workspace = true diff --git a/crates/anstyle-svg/LICENSE-APACHE b/crates/anstyle-svg/LICENSE-APACHE new file mode 100644 index 00000000..8f71f43f --- /dev/null +++ b/crates/anstyle-svg/LICENSE-APACHE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/crates/anstyle-svg/LICENSE-MIT b/crates/anstyle-svg/LICENSE-MIT new file mode 100644 index 00000000..a2d01088 --- /dev/null +++ b/crates/anstyle-svg/LICENSE-MIT @@ -0,0 +1,19 @@ +Copyright (c) Individual contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/crates/anstyle-svg/README.md b/crates/anstyle-svg/README.md new file mode 100644 index 00000000..917ef697 --- /dev/null +++ b/crates/anstyle-svg/README.md @@ -0,0 +1,26 @@ +# anstyle-svg + +> Convert ANSI escape codes to SVG + +[![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] +![License](https://img.shields.io/crates/l/anstyle-svg.svg) +[![Crates Status](https://img.shields.io/crates/v/anstyle-svg.svg)](https://crates.io/crates/anstyle-svg) + +## License + +Licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. + +[Crates.io]: https://crates.io/crates/anstyle-svg +[Documentation]: https://docs.rs/anstyle-svg diff --git a/crates/anstyle-svg/examples/convert.rs b/crates/anstyle-svg/examples/convert.rs new file mode 100644 index 00000000..d413c6ab --- /dev/null +++ b/crates/anstyle-svg/examples/convert.rs @@ -0,0 +1,11 @@ +use std::io::Read as _; + +fn main() { + let mut stdin = String::new(); + std::io::stdin().read_to_string(&mut stdin).unwrap(); + + let term = anstyle_svg::Term::new(); + let stdout = term.render_svg(&stdin); + + print!("{stdout}"); +} diff --git a/crates/anstyle-svg/rainbow.sh b/crates/anstyle-svg/rainbow.sh new file mode 100755 index 00000000..109acdd2 --- /dev/null +++ b/crates/anstyle-svg/rainbow.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env sh + +echo "color: foreground" +cargo run -p anstyle --example dump-style -- --layer fg +echo +echo "color: background" +cargo run -p anstyle --example dump-style -- --layer bg +echo +echo "color: underline" +cargo run -p anstyle --example dump-style -- --layer underline +echo +echo "italic" +cargo run -p anstyle --example dump-style -- --effect italic +echo +echo "bold" +cargo run -p anstyle --example dump-style -- --effect bold +echo +echo "dimmed" +cargo run -p anstyle --example dump-style -- --effect dimmed +echo +echo "underline" +cargo run -p anstyle --example dump-style -- --effect underline +echo +echo "double_underline" +cargo run -p anstyle --example dump-style -- --effect double_underline +echo +echo "curly_underline" +cargo run -p anstyle --example dump-style -- --effect curly_underline +echo +echo "dotted_underline" +cargo run -p anstyle --example dump-style -- --effect dotted_underline +echo +echo "dashed_underline" +cargo run -p anstyle --example dump-style -- --effect dashed_underline +echo +echo "blink" +cargo run -p anstyle --example dump-style -- --effect blink +echo +echo "invert" +cargo run -p anstyle --example dump-style -- --effect invert +echo +echo "hidden" +cargo run -p anstyle --example dump-style -- --effect hidden +echo +echo "strikethrough" +cargo run -p anstyle --example dump-style -- --effect strikethrough diff --git a/crates/anstyle-svg/src/lib.rs b/crates/anstyle-svg/src/lib.rs new file mode 100644 index 00000000..12b7f097 --- /dev/null +++ b/crates/anstyle-svg/src/lib.rs @@ -0,0 +1,455 @@ +//! Convert ANSI escape codes to SVG +//! +//! See [`Term`] +//! +//! # Example +//! +//! ``` +//! # use anstyle_svg::Term; +//! let vte = std::fs::read_to_string("tests/rainbow.vte").unwrap(); +//! let svg = Term::new().render_svg(&vte); +//! ``` +//! +//! ![demo of supported styles](https://raw.githubusercontent.com/rust-cli/anstyle/main/crates/anstyle-svg/tests/rainbow.svg "Example output") + +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] + +pub use anstyle_lossy::palette::Palette; +pub use anstyle_lossy::palette::VGA; +pub use anstyle_lossy::palette::WIN10_CONSOLE; + +/// Define the terminal-like settings for rendering outpu +#[derive(Copy, Clone, Debug)] +pub struct Term { + palette: Palette, + fg_color: anstyle::Color, + bg_color: anstyle::Color, + background: bool, + font_family: &'static str, + min_width_px: usize, + padding_px: usize, +} + +impl Term { + /// Default terminal settings + pub const fn new() -> Self { + Self { + palette: VGA, + fg_color: FG_COLOR, + bg_color: BG_COLOR, + background: true, + font_family: "SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace", + min_width_px: 720, + padding_px: 10, + } + } + + /// Select the color palette for [`anstyle::AnsiColor`] + pub const fn palette(mut self, palette: Palette) -> Self { + self.palette = palette; + self + } + + /// Select the default foreground color + pub const fn fg_color(mut self, color: anstyle::Color) -> Self { + self.fg_color = color; + self + } + + /// Select the default background color + pub const fn bg_color(mut self, color: anstyle::Color) -> Self { + self.bg_color = color; + self + } + + /// Toggle default background off with `false` + pub const fn background(mut self, yes: bool) -> Self { + self.background = yes; + self + } + + /// Minimum width for the text + pub const fn min_width_px(mut self, px: usize) -> Self { + self.min_width_px = px; + self + } + + /// Render the SVG with the terminal defined + /// + /// **Note:** Lines are not wrapped. This is intentional as this attempts to convey the exact + /// output with escape codes translated to SVG elements. + pub fn render_svg(&self, ansi: &str) -> String { + use std::fmt::Write as _; + use unicode_width::UnicodeWidthStr as _; + + const FG: &str = "fg"; + const BG: &str = "bg"; + + let mut styled = anstream::adapter::WinconBytes::new(); + let mut styled = styled.extract_next(ansi.as_bytes()).collect::>(); + let mut effects_in_use = anstyle::Effects::new(); + for (style, _) in &mut styled { + // Pre-process INVERT to make fg/bg calculations easier + if style.get_effects().contains(anstyle::Effects::INVERT) { + *style = style + .fg_color(Some(style.get_bg_color().unwrap_or(self.bg_color))) + .bg_color(Some(style.get_fg_color().unwrap_or(self.fg_color))) + .effects(style.get_effects().remove(anstyle::Effects::INVERT)); + } + effects_in_use |= style.get_effects(); + } + let styled_lines = split_lines(&styled); + + let fg_color = rgb_value(self.fg_color, self.palette); + let bg_color = rgb_value(self.bg_color, self.palette); + let font_family = self.font_family; + + let line_height = 18; + let height = styled_lines.len() * line_height + self.padding_px * 2; + let max_width = styled_lines + .iter() + .map(|l| l.iter().map(|(_, t)| t.width()).sum()) + .max() + .unwrap_or(0); + let width_px = (max_width as f64 * 8.4).ceil() as usize; + let width_px = std::cmp::max(width_px, self.min_width_px) + self.padding_px * 2; + + let mut buffer = String::new(); + writeln!( + &mut buffer, + r#""# + ) + .unwrap(); + writeln!(&mut buffer, r#" "#).unwrap(); + writeln!(&mut buffer).unwrap(); + + if self.background { + writeln!( + &mut buffer, + r#" "# + ) + .unwrap(); + writeln!(&mut buffer).unwrap(); + } + + let text_x = self.padding_px; + let mut text_y = self.padding_px + line_height; + writeln!( + &mut buffer, + r#" "# + ) + .unwrap(); + for line in &styled_lines { + if line.iter().any(|(s, _)| s.get_bg_color().is_some()) { + write!(&mut buffer, r#" "#).unwrap(); + for (style, fragment) in line { + if fragment.is_empty() { + continue; + } + write_bg_span(&mut buffer, style, fragment); + } + // HACK: must close tspan on newline to include them in copy/paste + writeln!(&mut buffer).unwrap(); + writeln!(&mut buffer, r#""#).unwrap(); + } + + write!(&mut buffer, r#" "#).unwrap(); + for (style, fragment) in line { + if fragment.is_empty() { + continue; + } + write_fg_span(&mut buffer, style, fragment); + } + // HACK: must close tspan on newline to include them in copy/paste + writeln!(&mut buffer).unwrap(); + writeln!(&mut buffer, r#""#).unwrap(); + + text_y += line_height; + } + writeln!(&mut buffer, r#" "#).unwrap(); + writeln!(&mut buffer).unwrap(); + + writeln!(&mut buffer, r#""#).unwrap(); + buffer + } +} + +const FG_COLOR: anstyle::Color = anstyle::Color::Ansi(anstyle::AnsiColor::White); +const BG_COLOR: anstyle::Color = anstyle::Color::Ansi(anstyle::AnsiColor::Black); + +fn write_fg_span(buffer: &mut String, style: &anstyle::Style, fragment: &str) { + use std::fmt::Write as _; + let fg_color = style.get_fg_color().map(|c| color_name(FG_PREFIX, c)); + let underline_color = style + .get_underline_color() + .map(|c| color_name(UNDERLINE_PREFIX, c)); + let effects = style.get_effects(); + let underline = effects.contains(anstyle::Effects::UNDERLINE); + let double_underline = effects.contains(anstyle::Effects::DOUBLE_UNDERLINE); + let curly_underline = effects.contains(anstyle::Effects::CURLY_UNDERLINE); + let dotted_underline = effects.contains(anstyle::Effects::DOTTED_UNDERLINE); + let dashed_underline = effects.contains(anstyle::Effects::DASHED_UNDERLINE); + let strikethrough = effects.contains(anstyle::Effects::STRIKETHROUGH); + // skipping INVERT as that was handled earlier + let bold = effects.contains(anstyle::Effects::BOLD); + let italic = effects.contains(anstyle::Effects::ITALIC); + let dimmed = effects.contains(anstyle::Effects::DIMMED); + let hidden = effects.contains(anstyle::Effects::HIDDEN); + + let fragment = html_escape::encode_text(fragment); + let mut classes = Vec::new(); + if let Some(class) = fg_color.as_deref() { + classes.push(class); + } + if let Some(class) = underline_color.as_deref() { + classes.push(class); + } + if underline { + classes.push("underline"); + } + if double_underline { + classes.push("double-underline"); + } + if curly_underline { + classes.push("curly-underline"); + } + if dotted_underline { + classes.push("dotted-underline"); + } + if dashed_underline { + classes.push("dashed-underline"); + } + if strikethrough { + classes.push("strikethrough"); + } + if bold { + classes.push("bold"); + } + if italic { + classes.push("italic"); + } + if dimmed { + classes.push("dimmed"); + } + if hidden { + classes.push("hidden"); + } + + write!(buffer, r#""#).unwrap(); + write!(buffer, "{fragment}").unwrap(); + write!(buffer, r#""#).unwrap(); +} + +fn write_bg_span(buffer: &mut String, style: &anstyle::Style, fragment: &str) { + use std::fmt::Write as _; + use unicode_width::UnicodeWidthStr; + + let bg_color = style.get_bg_color().map(|c| color_name(BG_PREFIX, c)); + + let fill = if bg_color.is_some() { "█" } else { " " }; + + let fragment = html_escape::encode_text(fragment); + let width = fragment.width(); + let fragment = fill.repeat(width); + let mut classes = Vec::new(); + if let Some(class) = bg_color.as_deref() { + classes.push(class); + } + write!(buffer, r#""#).unwrap(); + write!(buffer, "{fragment}").unwrap(); + write!(buffer, r#""#).unwrap(); +} + +impl Default for Term { + fn default() -> Self { + Self::new() + } +} + +const ANSI_NAMES: [&str; 16] = [ + "black", + "red", + "green", + "yellow", + "blue", + "magenta", + "cyan", + "white", + "bright-black", + "bright-red", + "bright-green", + "bright-yellow", + "bright-blue", + "bright-magenta", + "bright-cyan", + "bright-white", +]; + +fn rgb_value(color: anstyle::Color, palette: Palette) -> String { + let color = anstyle_lossy::color_to_rgb(color, palette); + let anstyle::RgbColor(r, g, b) = color; + format!("#{r:02X}{g:02X}{b:02X}") +} + +const FG_PREFIX: &str = "fg"; +const BG_PREFIX: &str = "bg"; +const UNDERLINE_PREFIX: &str = "underline"; + +fn color_name(prefix: &str, color: anstyle::Color) -> String { + match color { + anstyle::Color::Ansi(color) => { + let color = anstyle::Ansi256Color::from_ansi(color); + let index = color.index() as usize; + let name = ANSI_NAMES[index]; + format!("{prefix}-{name}") + } + anstyle::Color::Ansi256(color) => { + let index = color.index(); + format!("{prefix}-ansi256-{index:03}") + } + anstyle::Color::Rgb(color) => { + let anstyle::RgbColor(r, g, b) = color; + format!("{prefix}-rgb-{r:02X}{g:02X}{b:02X}") + } + } +} + +fn color_styles( + styled: &[(anstyle::Style, String)], + palette: Palette, +) -> impl Iterator { + let mut colors = std::collections::BTreeMap::new(); + for (style, _) in styled { + if let Some(color) = style.get_fg_color() { + colors.insert(color_name(FG_PREFIX, color), rgb_value(color, palette)); + } + if let Some(color) = style.get_bg_color() { + colors.insert(color_name(BG_PREFIX, color), rgb_value(color, palette)); + } + if let Some(color) = style.get_underline_color() { + colors.insert( + color_name(UNDERLINE_PREFIX, color), + rgb_value(color, palette), + ); + } + } + + colors.into_iter() +} + +fn split_lines(styled: &[(anstyle::Style, String)]) -> Vec> { + let mut lines = Vec::new(); + let mut current_line = Vec::new(); + for (style, mut next) in styled.iter().map(|(s, t)| (*s, t.as_str())) { + while let Some((current, remaining)) = next.split_once('\n') { + let current = current.strip_suffix('\r').unwrap_or(current); + current_line.push((style, current)); + lines.push(current_line); + current_line = Vec::new(); + next = remaining; + } + current_line.push((style, next)); + } + if !current_line.is_empty() { + lines.push(current_line); + } + lines +} diff --git a/crates/anstyle-svg/tests/rainbow.svg b/crates/anstyle-svg/tests/rainbow.svg new file mode 100644 index 00000000..4bb6c3a9 --- /dev/null +++ b/crates/anstyle-svg/tests/rainbow.svg @@ -0,0 +1,1225 @@ + + + + + + + color: foreground + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + color: background + + ████████████████████████ + + 0 1 2 3 4 5 6 7 + + ████████████████████████ + + 8 9 A B C D E F + + + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + ████████████████████████████████████████████████████████████████████████ + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + color: underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + italic + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + bold + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + dimmed + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + double_underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + curly_underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + dotted_underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + dashed_underline + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + blink + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + invert + + ████████████████████████ + + 0 1 2 3 4 5 6 7 + + ████████████████████████ + + 8 9 A B C D E F + + + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + ████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + ████████████████████████████████████████████████████████████████████████ + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + hidden + + + + + + + + + + + + + + + + + + + + + + + + + + strikethrough + + 0 1 2 3 4 5 6 7 + + 8 9 A B C D E F + + + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + + + + + + diff --git a/crates/anstyle-svg/tests/rainbow.vte b/crates/anstyle-svg/tests/rainbow.vte new file mode 100644 index 00000000..3ce0974d --- /dev/null +++ b/crates/anstyle-svg/tests/rainbow.vte @@ -0,0 +1,194 @@ +color: foreground + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +color: background + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +color: underline + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +italic + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +bold + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +dimmed + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +underline + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +double_underline + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +curly_underline +[4:3m 0[4:3m 1[4:3m 2[4:3m 3[4:3m 4[4:3m 5[4:3m 6[4:3m 7 +[4:3m 8[4:3m 9[4:3m A[4:3m B[4:3m C[4:3m D[4:3m E[4:3m F + +[4:3m 10[4:3m 11[4:3m 12[4:3m 13[4:3m 14[4:3m 15[4:3m 16[4:3m 17[4:3m 18[4:3m 19[4:3m 1A[4:3m 1B[4:3m 1C[4:3m 1D[4:3m 1E[4:3m 1F[4:3m 20[4:3m 21[4:3m 22[4:3m 23[4:3m 24[4:3m 25[4:3m 26[4:3m 27[4:3m 28[4:3m 29[4:3m 2A[4:3m 2B[4:3m 2C[4:3m 2D[4:3m 2E[4:3m 2F[4:3m 30[4:3m 31[4:3m 32[4:3m 33 +[4:3m 34[4:3m 35[4:3m 36[4:3m 37[4:3m 38[4:3m 39[4:3m 3A[4:3m 3B[4:3m 3C[4:3m 3D[4:3m 3E[4:3m 3F[4:3m 40[4:3m 41[4:3m 42[4:3m 43[4:3m 44[4:3m 45[4:3m 46[4:3m 47[4:3m 48[4:3m 49[4:3m 4A[4:3m 4B[4:3m 4C[4:3m 4D[4:3m 4E[4:3m 4F[4:3m 50[4:3m 51[4:3m 52[4:3m 53[4:3m 54[4:3m 55[4:3m 56[4:3m 57 +[4:3m 58[4:3m 59[4:3m 5A[4:3m 5B[4:3m 5C[4:3m 5D[4:3m 5E[4:3m 5F[4:3m 60[4:3m 61[4:3m 62[4:3m 63[4:3m 64[4:3m 65[4:3m 66[4:3m 67[4:3m 68[4:3m 69[4:3m 6A[4:3m 6B[4:3m 6C[4:3m 6D[4:3m 6E[4:3m 6F[4:3m 70[4:3m 71[4:3m 72[4:3m 73[4:3m 74[4:3m 75[4:3m 76[4:3m 77[4:3m 78[4:3m 79[4:3m 7A[4:3m 7B +[4:3m 7C[4:3m 7D[4:3m 7E[4:3m 7F[4:3m 80[4:3m 81[4:3m 82[4:3m 83[4:3m 84[4:3m 85[4:3m 86[4:3m 87[4:3m 88[4:3m 89[4:3m 8A[4:3m 8B[4:3m 8C[4:3m 8D[4:3m 8E[4:3m 8F[4:3m 90[4:3m 91[4:3m 92[4:3m 93[4:3m 94[4:3m 95[4:3m 96[4:3m 97[4:3m 98[4:3m 99[4:3m 9A[4:3m 9B[4:3m 9C[4:3m 9D[4:3m 9E[4:3m 9F +[4:3m A0[4:3m A1[4:3m A2[4:3m A3[4:3m A4[4:3m A5[4:3m A6[4:3m A7[4:3m A8[4:3m A9[4:3m AA[4:3m AB[4:3m AC[4:3m AD[4:3m AE[4:3m AF[4:3m B0[4:3m B1[4:3m B2[4:3m B3[4:3m B4[4:3m B5[4:3m B6[4:3m B7[4:3m B8[4:3m B9[4:3m BA[4:3m BB[4:3m BC[4:3m BD[4:3m BE[4:3m BF[4:3m C0[4:3m C1[4:3m C2[4:3m C3 +[4:3m C4[4:3m C5[4:3m C6[4:3m C7[4:3m C8[4:3m C9[4:3m CA[4:3m CB[4:3m CC[4:3m CD[4:3m CE[4:3m CF[4:3m D0[4:3m D1[4:3m D2[4:3m D3[4:3m D4[4:3m D5[4:3m D6[4:3m D7[4:3m D8[4:3m D9[4:3m DA[4:3m DB[4:3m DC[4:3m DD[4:3m DE[4:3m DF[4:3m E0[4:3m E1[4:3m E2[4:3m E3[4:3m E4[4:3m E5[4:3m E6[4:3m E7 + +[4:3m E8[4:3m E9[4:3m EA[4:3m EB[4:3m EC[4:3m ED[4:3m EE[4:3m EF[4:3m F0[4:3m F1[4:3m F2[4:3m F3[4:3m F4[4:3m F5[4:3m F6[4:3m F7[4:3m F8[4:3m F9[4:3m FA[4:3m FB[4:3m FC[4:3m FD[4:3m FE[4:3m FF + +dotted_underline +[4:4m 0[4:4m 1[4:4m 2[4:4m 3[4:4m 4[4:4m 5[4:4m 6[4:4m 7 +[4:4m 8[4:4m 9[4:4m A[4:4m B[4:4m C[4:4m D[4:4m E[4:4m F + +[4:4m 10[4:4m 11[4:4m 12[4:4m 13[4:4m 14[4:4m 15[4:4m 16[4:4m 17[4:4m 18[4:4m 19[4:4m 1A[4:4m 1B[4:4m 1C[4:4m 1D[4:4m 1E[4:4m 1F[4:4m 20[4:4m 21[4:4m 22[4:4m 23[4:4m 24[4:4m 25[4:4m 26[4:4m 27[4:4m 28[4:4m 29[4:4m 2A[4:4m 2B[4:4m 2C[4:4m 2D[4:4m 2E[4:4m 2F[4:4m 30[4:4m 31[4:4m 32[4:4m 33 +[4:4m 34[4:4m 35[4:4m 36[4:4m 37[4:4m 38[4:4m 39[4:4m 3A[4:4m 3B[4:4m 3C[4:4m 3D[4:4m 3E[4:4m 3F[4:4m 40[4:4m 41[4:4m 42[4:4m 43[4:4m 44[4:4m 45[4:4m 46[4:4m 47[4:4m 48[4:4m 49[4:4m 4A[4:4m 4B[4:4m 4C[4:4m 4D[4:4m 4E[4:4m 4F[4:4m 50[4:4m 51[4:4m 52[4:4m 53[4:4m 54[4:4m 55[4:4m 56[4:4m 57 +[4:4m 58[4:4m 59[4:4m 5A[4:4m 5B[4:4m 5C[4:4m 5D[4:4m 5E[4:4m 5F[4:4m 60[4:4m 61[4:4m 62[4:4m 63[4:4m 64[4:4m 65[4:4m 66[4:4m 67[4:4m 68[4:4m 69[4:4m 6A[4:4m 6B[4:4m 6C[4:4m 6D[4:4m 6E[4:4m 6F[4:4m 70[4:4m 71[4:4m 72[4:4m 73[4:4m 74[4:4m 75[4:4m 76[4:4m 77[4:4m 78[4:4m 79[4:4m 7A[4:4m 7B +[4:4m 7C[4:4m 7D[4:4m 7E[4:4m 7F[4:4m 80[4:4m 81[4:4m 82[4:4m 83[4:4m 84[4:4m 85[4:4m 86[4:4m 87[4:4m 88[4:4m 89[4:4m 8A[4:4m 8B[4:4m 8C[4:4m 8D[4:4m 8E[4:4m 8F[4:4m 90[4:4m 91[4:4m 92[4:4m 93[4:4m 94[4:4m 95[4:4m 96[4:4m 97[4:4m 98[4:4m 99[4:4m 9A[4:4m 9B[4:4m 9C[4:4m 9D[4:4m 9E[4:4m 9F +[4:4m A0[4:4m A1[4:4m A2[4:4m A3[4:4m A4[4:4m A5[4:4m A6[4:4m A7[4:4m A8[4:4m A9[4:4m AA[4:4m AB[4:4m AC[4:4m AD[4:4m AE[4:4m AF[4:4m B0[4:4m B1[4:4m B2[4:4m B3[4:4m B4[4:4m B5[4:4m B6[4:4m B7[4:4m B8[4:4m B9[4:4m BA[4:4m BB[4:4m BC[4:4m BD[4:4m BE[4:4m BF[4:4m C0[4:4m C1[4:4m C2[4:4m C3 +[4:4m C4[4:4m C5[4:4m C6[4:4m C7[4:4m C8[4:4m C9[4:4m CA[4:4m CB[4:4m CC[4:4m CD[4:4m CE[4:4m CF[4:4m D0[4:4m D1[4:4m D2[4:4m D3[4:4m D4[4:4m D5[4:4m D6[4:4m D7[4:4m D8[4:4m D9[4:4m DA[4:4m DB[4:4m DC[4:4m DD[4:4m DE[4:4m DF[4:4m E0[4:4m E1[4:4m E2[4:4m E3[4:4m E4[4:4m E5[4:4m E6[4:4m E7 + +[4:4m E8[4:4m E9[4:4m EA[4:4m EB[4:4m EC[4:4m ED[4:4m EE[4:4m EF[4:4m F0[4:4m F1[4:4m F2[4:4m F3[4:4m F4[4:4m F5[4:4m F6[4:4m F7[4:4m F8[4:4m F9[4:4m FA[4:4m FB[4:4m FC[4:4m FD[4:4m FE[4:4m FF + +dashed_underline +[4:5m 0[4:5m 1[4:5m 2[4:5m 3[4:5m 4[4:5m 5[4:5m 6[4:5m 7 +[4:5m 8[4:5m 9[4:5m A[4:5m B[4:5m C[4:5m D[4:5m E[4:5m F + +[4:5m 10[4:5m 11[4:5m 12[4:5m 13[4:5m 14[4:5m 15[4:5m 16[4:5m 17[4:5m 18[4:5m 19[4:5m 1A[4:5m 1B[4:5m 1C[4:5m 1D[4:5m 1E[4:5m 1F[4:5m 20[4:5m 21[4:5m 22[4:5m 23[4:5m 24[4:5m 25[4:5m 26[4:5m 27[4:5m 28[4:5m 29[4:5m 2A[4:5m 2B[4:5m 2C[4:5m 2D[4:5m 2E[4:5m 2F[4:5m 30[4:5m 31[4:5m 32[4:5m 33 +[4:5m 34[4:5m 35[4:5m 36[4:5m 37[4:5m 38[4:5m 39[4:5m 3A[4:5m 3B[4:5m 3C[4:5m 3D[4:5m 3E[4:5m 3F[4:5m 40[4:5m 41[4:5m 42[4:5m 43[4:5m 44[4:5m 45[4:5m 46[4:5m 47[4:5m 48[4:5m 49[4:5m 4A[4:5m 4B[4:5m 4C[4:5m 4D[4:5m 4E[4:5m 4F[4:5m 50[4:5m 51[4:5m 52[4:5m 53[4:5m 54[4:5m 55[4:5m 56[4:5m 57 +[4:5m 58[4:5m 59[4:5m 5A[4:5m 5B[4:5m 5C[4:5m 5D[4:5m 5E[4:5m 5F[4:5m 60[4:5m 61[4:5m 62[4:5m 63[4:5m 64[4:5m 65[4:5m 66[4:5m 67[4:5m 68[4:5m 69[4:5m 6A[4:5m 6B[4:5m 6C[4:5m 6D[4:5m 6E[4:5m 6F[4:5m 70[4:5m 71[4:5m 72[4:5m 73[4:5m 74[4:5m 75[4:5m 76[4:5m 77[4:5m 78[4:5m 79[4:5m 7A[4:5m 7B +[4:5m 7C[4:5m 7D[4:5m 7E[4:5m 7F[4:5m 80[4:5m 81[4:5m 82[4:5m 83[4:5m 84[4:5m 85[4:5m 86[4:5m 87[4:5m 88[4:5m 89[4:5m 8A[4:5m 8B[4:5m 8C[4:5m 8D[4:5m 8E[4:5m 8F[4:5m 90[4:5m 91[4:5m 92[4:5m 93[4:5m 94[4:5m 95[4:5m 96[4:5m 97[4:5m 98[4:5m 99[4:5m 9A[4:5m 9B[4:5m 9C[4:5m 9D[4:5m 9E[4:5m 9F +[4:5m A0[4:5m A1[4:5m A2[4:5m A3[4:5m A4[4:5m A5[4:5m A6[4:5m A7[4:5m A8[4:5m A9[4:5m AA[4:5m AB[4:5m AC[4:5m AD[4:5m AE[4:5m AF[4:5m B0[4:5m B1[4:5m B2[4:5m B3[4:5m B4[4:5m B5[4:5m B6[4:5m B7[4:5m B8[4:5m B9[4:5m BA[4:5m BB[4:5m BC[4:5m BD[4:5m BE[4:5m BF[4:5m C0[4:5m C1[4:5m C2[4:5m C3 +[4:5m C4[4:5m C5[4:5m C6[4:5m C7[4:5m C8[4:5m C9[4:5m CA[4:5m CB[4:5m CC[4:5m CD[4:5m CE[4:5m CF[4:5m D0[4:5m D1[4:5m D2[4:5m D3[4:5m D4[4:5m D5[4:5m D6[4:5m D7[4:5m D8[4:5m D9[4:5m DA[4:5m DB[4:5m DC[4:5m DD[4:5m DE[4:5m DF[4:5m E0[4:5m E1[4:5m E2[4:5m E3[4:5m E4[4:5m E5[4:5m E6[4:5m E7 + +[4:5m E8[4:5m E9[4:5m EA[4:5m EB[4:5m EC[4:5m ED[4:5m EE[4:5m EF[4:5m F0[4:5m F1[4:5m F2[4:5m F3[4:5m F4[4:5m F5[4:5m F6[4:5m F7[4:5m F8[4:5m F9[4:5m FA[4:5m FB[4:5m FC[4:5m FD[4:5m FE[4:5m FF + +blink + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +invert + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +hidden + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF + +strikethrough + 0 1 2 3 4 5 6 7 + 8 9 A B C D E F + + 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 + 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 + 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B + 7C 7D 7E 7F 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F + A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3 + C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 + + E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF diff --git a/crates/anstyle-svg/tests/rg_linus.svg b/crates/anstyle-svg/tests/rg_linus.svg new file mode 100644 index 00000000..09b882d4 --- /dev/null +++ b/crates/anstyle-svg/tests/rg_linus.svg @@ -0,0 +1,2344 @@ + + + + + + + kernel/sys.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/fork.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/exit.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/time/timer.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/time/time.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/user.c: * (C) Copyright 1991-2000 Linus Torvalds + + kernel/ptrace.c: * (C) Copyright 1999 Linus Torvalds + + kernel/irq/irqdesc.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/irq/spurious.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar + + kernel/irq/autoprobe.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar + + kernel/irq/chip.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/irq/proc.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar + + kernel/irq/dummychip.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/irq/handle.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/irq/resend.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/irq/manage.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar + + kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/futex/core.c: * enough at me, Linus for the original (flawed) idea, Matthew + + kernel/resource.c: * Copyright (C) 1999 Linus Torvalds + + kernel/softirq.c: * Copyright (C) 1992 Linus Torvalds + + kernel/printk/printk.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/sched/core.c: * Copyright (C) 1991-2002 Linus Torvalds + + kernel/panic.c: * Copyright (C) 1991, 1992 Linus Torvalds + + kernel/locking/spinlock.c: * Copyright (2004) Linus Torvalds + + kernel/reboot.c: * Copyright (C) 2013 Linus Torvalds + + LICENSES/exceptions/Linux-syscall-note: Linus Torvalds + + tools/build/Build.include:# Copyright (C) Linus Torvalds <torvalds@linux-foundation.org>, 2015 + + tools/build/Makefile.build:# Copyright (C) Linus Torvalds <torvalds@linux-foundation.org>, 2015 + + tools/perf/CREDITS: Linus Torvalds + + tools/perf/util/config.c: * Copyright (C) Linus Torvalds, 2005 + + tools/testing/selftests/vm/charge_reserved_hugetlb.sh: # On linus/master, the above process gets SIGBUS'd on oomkill, with + + tools/perf/util/usage.c: * Copyright (C) Linus Torvalds, 2005 + + tools/testing/selftests/powerpc/stringloops/string.c: * Copyright (C) 1991, 1992 Linus Torvalds + + tools/lib/string.c: * Copyright (C) 1991, 1992 Linus Torvalds + + tools/lib/ctype.c: * Copyright (C) 1991, 1992 Linus Torvalds + + tools/scripts/Makefile.include:# that takes into account Linus's comments (search for Wshadow) for the reasoning about + + tools/gpio/gpio-utils.h: * Copyright (C) 2015 Linus Walleij + + tools/gpio/gpio-utils.c: * Copyright (C) 2015 Linus Walleij + + tools/gpio/gpio-event-mon.c: * Copyright (C) 2016 Linus Walleij + + tools/gpio/gpio-hammer.c: * Copyright (C) 2016 Linus Walleij + + tools/gpio/lsgpio.c: * Copyright (C) 2015 Linus Walleij + + tools/power/cpupower/utils/idle_monitor/mperf_monitor.c: * Compare with Linus kernel git commit: acf01734b1747b1ec4 + + tools/power/cpupower/utils/cpupower.c: * Ideas taken over from the perf userspace tool (included in the Linus + + init/calibrate.c: * Copyright (C) 1991, 1992 Linus Torvalds + + security/Kconfig.hardening: https://git.kernel.org/linus/b9e146d8eb3b9eca + + security/Kconfig.hardening: https://git.kernel.org/linus/06e7e776ca4d3654 + + block/partitions/efi.c: * - Ported to 2.5.2-pre11 + library crc32 patch Linus applied + + block/bdev.c: * Copyright (C) 1991, 1992 Linus Torvalds + + block/fops.c: * Copyright (C) 1991, 1992 Linus Torvalds + + block/blk-core.c: * Copyright (C) 1991, 1992 Linus Torvalds + + block/partitions/osf.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/amiga.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/sun.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/msdos.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/mac.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/atari.c: * Copyright (C) 1991-1998 Linus Torvalds + + block/partitions/core.c: * Copyright (C) 1991-1998 Linus Torvalds + + init/main.c: * Copyright (C) 1991, 1992 Linus Torvalds + + MAINTAINERS: job the maintainers (and especially Linus) do is to keep things + + MAINTAINERS: your changes in a branch derived from Linus' latest git tree. + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linusw@kernel.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> + + MAINTAINERS:M: Linus Torvalds <torvalds@linux-foundation.org> + + CREDITS: Linus + + CREDITS:N: Linus Torvalds + + scripts/Makefile.build:# Linus' kernel sanity checking tool + + Documentation/networking/netdev-FAQ.rst:mainline tree from Linus, and ``net-next`` is where the new code goes + + Documentation/networking/netdev-FAQ.rst:How often do changes from these trees make it to the mainline Linus tree? + + Documentation/networking/netdev-FAQ.rst:to Linus for merging into the mainline tree. After the two weeks, the + + Documentation/networking/netdev-FAQ.rst:mainline/Linus via a pull request for vX.Y -- at the same time, the + + Documentation/networking/netdev-FAQ.rst:fed back to Linus at regular (~weekly) intervals. Meaning that the + + Documentation/networking/netdev-FAQ.rst:Load the mainline (Linus) page here: + + lib/vsprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds + + lib/vsprintf.c:/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ + + drivers/dma/s3c24xx-dma.c: * Author: Linus Walleij <linus.walleij@stericsson.com> + + lib/string.c: * Copyright (C) 1991, 1992 Linus Torvalds + + lib/kasprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds + + lib/iomap.c: * (C) Copyright 2004 Linus Torvalds + + drivers/dma/amba-pl08x.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/thermal/db8500_thermal.c: * Authors: Hongbo Zhang, Linus Walleij + + drivers/auxdisplay/arm-charlcd.c: * Author: Linus Walleij <triad@df.lth.se> + + drivers/gpu/drm/tve200/tve200_drm.h: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/tve200/tve200_display.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/tve200/tve200_drv.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/tve200/tve200_drv.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/mcde/mcde_display.c: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/mcde/mcde_drm.h: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/mcde/mcde_drv.c: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/mcde/mcde_drv.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-sony-acx424akp.c: * Author: Linus Walleij + + drivers/gpu/drm/panel/panel-sony-acx424akp.c:MODULE_AUTHOR("Linus Wallei <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-ilitek-ili9341.c: * the reuse of DBI abstraction part referred from Linus's patch + + drivers/gpu/drm/panel/panel-ilitek-ili9322.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/panel/panel-ilitek-ili9322.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-arm-versatile.c: * Linus Walleij <linus.wallei@linaro.org> + + drivers/gpu/drm/panel/panel-arm-versatile.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-novatek-nt35510.c: * Copyright (C) 2020 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/panel/panel-novatek-nt35510.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-samsung-db7430.c: * Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/panel/panel-samsung-db7430.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-samsung-s6d16d0.c:MODULE_AUTHOR("Linus Wallei <linus.walleij@linaro.org>"); + + drivers/bus/arm-integrator-lm.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/bus/arm-integrator-lm.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-widechips-ws2401.c: * Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/panel/panel-widechips-ws2401.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c: * (C) 2019 Linus Walleij + + drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c:MODULE_AUTHOR("Linus Walleij <linusw@kernel.org>"); + + drivers/bus/qcom-ebi2.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/bus/qcom-ebi2.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpu/drm/panel/panel-tpo-tpg110.c: * Linus Walleij <linus.walleij@linaro.org> + + drivers/gpu/drm/panel/panel-tpo-tpg110.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/spi/spi-pl022.c: * Author: Linus Walleij <linus.walleij@stericsson.com> + + drivers/spi/spi-pl022.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); + + drivers/spi/spi-gpio.c: * Copyright (C) 2017 Linus Walleij + + drivers/bus/intel-ixp4xx-eb.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/bus/intel-ixp4xx-eb.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/char/mem.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/char/lp.c: * Copyright (C) 1992 by Jim Weigand and Linus Torvalds + + drivers/char/misc.c: * Based on code from Linus + + drivers/char/misc.c: * of the misc drivers, as they are now completely independent. Linus. + + drivers/char/agp/efficeon-agp.c: * Based upon a diff by Linus around November '02. + + drivers/mfd/ipaq-micro.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/mfd/stw481x.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/mfd/stw481x.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/irqchip/irq-xtensa-pic.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + drivers/pinctrl/pinconf.h: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/irqchip/irq-i8259.c: * Copyright (C) 1992 Linus Torvalds + + drivers/pinctrl/pinmux.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/pinctrl-gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/core.h: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/pinconf.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/nomadik/pinctrl-nomadik.c: * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/pinconf-generic.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/pinctrl/pinmux.h: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/irqchip/irq-ftintc010.c: * irqchip for the Faraday Technology FTINTC010 Copyright (C) 2017 Linus + + drivers/irqchip/irq-ftintc010.c: * Walleij <linus.walleij@linaro.org> + + drivers/irqchip/irq-gic-realview.c: * Copyright (C) 2015 Linus Walleij + + drivers/mfd/tps6105x.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/mfd/tps6105x.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/pinctrl/core.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/irqchip/irq-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> + + Documentation/networking/device_drivers/hamradio/z8530drv.rst:Many thanks to Linus Torvalds and Alan Cox for including the driver + + drivers/pcmcia/cardbus.c: * Linus, Jan 2000 + + drivers/mtd/maps/physmap-gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/mtd/maps/physmap-versatile.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/pcmcia/yenta_socket.c: * (C) Copyright 1999, 2000 Linus Torvalds + + drivers/mtd/parsers/afs.c: Copyright (C) 2019 Linus Walleij + + drivers/mtd/maps/physmap-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> + + lib/ctype.c: * Copyright (C) 1991, 1992 Linus Torvalds + + lib/pci_iomap.c: * (C) Copyright 2004 Linus Torvalds + + drivers/block/floppy.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/block/floppy.c: * by entropy@wintermute.wpi.edu (Lawrence Foard). Linus. + + drivers/block/floppy.c: * 1993/4/29 -- Linus -- cleaned up the timer handling in the kernel, and + + drivers/usb/core/hub.h: * Copyright (C) 1999 Linus Torvalds + + drivers/usb/core/generic.c: * (C) Copyright Linus Torvalds 1999 + + drivers/usb/core/hcd.c: * (C) Copyright Linus Torvalds 1999 + + drivers/usb/misc/sisusbvga/sisusb_con.c: * based on code Copyright (C) 1991, 1992 Linus Torvalds + + drivers/usb/core/usb.c: * (C) Copyright Linus Torvalds 1999 + + drivers/usb/core/driver.c: * (C) Copyright Linus Torvalds 1999 + + drivers/usb/core/hub.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/core/file.c: * (C) Copyright Linus Torvalds 1999 + + Documentation/arm/tcm.rst:Written by Linus Walleij <linus.walleij@stericsson.com> + + drivers/usb/mon/mon_bin.c:/* #2 used to be MON_IOCX_URB, removed before it got into Linus tree */ + + Documentation/locking/spinlocks.rst: Linus + + Documentation/spi/spi-summary.rst:- Linus Walleij + + drivers/usb/host/bcma-hcd.c: * Copyright 1999 Linus Torvalds + + drivers/usb/host/ehci-platform.c: * Copyright 1999 Linus Torvalds + + drivers/usb/host/uhci-grlib.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/host/ohci-hcd.c: * [ Initialisation is based on Linus' ] + + drivers/usb/host/ohci-hcd.c: * [ (C) Copyright 1999 Linus Torvalds ] + + drivers/usb/host/ssb-hcd.c: * Copyright 1999 Linus Torvalds + + drivers/usb/host/uhci-hub.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/host/uhci-pci.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/host/ohci.h: * a subset of what the full implementation needs. (Linus) + + drivers/usb/host/uhci-debug.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/host/ohci-pci.c: * [ Initialisation is based on Linus' ] + + drivers/usb/host/ohci-pci.c: * [ (C) Copyright 1999 Linus Torvalds ] + + drivers/usb/host/ohci-platform.c: * Copyright 1999 Linus Torvalds + + drivers/usb/host/uhci-hcd.c: * (C) Copyright 1999 Linus Torvalds + + drivers/usb/host/uhci-hcd.c: "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, " \ + + drivers/usb/host/uhci-q.c: * (C) Copyright 1999 Linus Torvalds + + scripts/patch-kernel:# directory above to the latest Linus kernel + + scripts/patch-kernel:# Note: It uses the patches relative to the Linus kernels, not the + + scripts/get_maintainer.pl:push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org"); + + scripts/get_maintainer.pl: warn("Try Linus Torvalds' latest git repository using:\n"); + + Documentation/RCU/rcu_dereference.rst: rcu_dereference() against non-NULL values. As Linus Torvalds + + Documentation/RCU/RTFP.txt:[LinusTorvalds2011Linux2:6:38:rc1:NPigginVFS], an RCU-protected red-black + + Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2001a + + Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" + + Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2003a + + Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" + + Documentation/RCU/RTFP.txt: Linus suggests replacing brlock with RCU and/or seqlocks: + + Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2011Linux2:6:38:rc1:NPigginVFS + + Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" + + Documentation/cdrom/cdrom-standard.rst:of course, I want to thank Linus Torvalds for making this possible in + + Documentation/RCU/Design/Requirements/Requirements.rst:This all should be quite obvious, but the fact remains that Linus + + Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst:Linux is a registered trademark of Linus Torvalds. + + Documentation/RCU/Design/Data-Structures/Data-Structures.rst:Linux is a registered trademark of Linus Torvalds. + + Documentation/security/lsm.rst:In response to the NSA presentation, Linus Torvalds made a set of + + Documentation/security/lsm.rst:desired model of security. Linus also suggested the possibility of + + scripts/package/mkdebian:Copyright: 1991 - 2018 Linus Torvalds and others. + + drivers/hwmon/drivetemp.c: * (C) 2018 Linus Walleij + + drivers/hwmon/drivetemp.c:MODULE_AUTHOR("Guenter Roeck <linus@roeck-us.net>"); + + scripts/checkstack.pl:# Inspired by Linus Torvalds + + Documentation/vm/active_mm.rst: From: Linus Torvalds <torvalds () transmeta ! com> + + Documentation/block/biodoc.rst:Larry McVoy (and subsequent discussions on lkml, and Linus' comments - Jan 2001 + + Documentation/block/biodoc.rst:On lkml between sct, linus, alan et al - Feb-March 2001 (many of the + + Documentation/usb/CREDITS: Linus Torvalds <torvalds@linux-foundation.org> + + Documentation/usb/CREDITS: - Linus Torvalds, for starting, developing and managing Linux. + + Documentation/ABI/obsolete/sysfs-gpio:Contact: Linus Walleij <linusw@kernel.org> + + Documentation/userspace-api/ioctl/ioctl-number.rst:patch to Linus Torvalds. Or you can e-mail me at <mec@shout.net> and + + Documentation/sound/hd-audio/notes.rst:and next kernels are found in for-linus and for-next branches, + + Documentation/process/maintainer-pgp-guide.rst:auto-retrieve the keys for Linus Torvalds and Greg Kroah-Hartman (if you + + Documentation/process/maintainer-pgp-guide.rst:``C94035C21B4F2AEB``. Now display the key of Linus Torvalds that you + + Documentation/process/maintainer-pgp-guide.rst: uid [ unknown] Linus Torvalds <torvalds@kernel.org> + + Documentation/process/maintainer-pgp-guide.rst:Next, find a trust path from Linus Torvalds to the key-id you found via ``gpg + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/771c035372a036f83353eef46dbb829780330234>`_ + + Documentation/process/deprecated.rst:to debug or even get viable crash reports. Linus has `very strong + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/d4689846881d160a4d12a514e991a740bcb5d65a>`_.) + + Documentation/process/deprecated.rst:Paraphrasing Linus's current `guidance <https://lore.kernel.org/lkml/CA+55aFwQEd_d40g4mUCSsVRZzrFPUJt74vc6PPpb675hYNXcKw@mail.gmail.com/>`_: + + Documentation/process/deprecated.rst: up to Linus's scrutiny, maybe you can use "%px", along with making sure + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/5ead723a20e0447bc7db33dc3070b420e5f80aa6>`_". + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/02361bc77888>`_ are reason enough to + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/76497732932f15e7323dc805e8ea8dc11bb587cf>`_ + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/f2cd32a443da694ac4e28fbf4ac6f9d5cc63a539>`_, + + Documentation/process/deprecated.rst:<https://git.kernel.org/linus/ab91c2a89f86be2898cee208d492816ec238b2cf>`_. + + Documentation/process/2.Process.rst:time, Linus Torvalds will declare that the window is closed and release the + + Documentation/process/2.Process.rst:time. Linus releases new -rc kernels about once a week; a normal series + + Documentation/process/2.Process.rst: merged into the mainline repository managed by Linus Torvalds. More + + Documentation/process/2.Process.rst:repository: Linus Torvalds. But, for example, of the over 9,500 patches + + Documentation/process/2.Process.rst:chosen by Linus himself. The kernel project has long since grown to a size + + Documentation/process/2.Process.rst:When the merge window opens, top-level maintainers will ask Linus to "pull" + + Documentation/process/2.Process.rst:Linus agrees, the stream of patches will flow up into his repository, + + Documentation/process/2.Process.rst:becoming part of the mainline kernel. The amount of attention that Linus + + Documentation/process/2.Process.rst:that, sometimes, he looks quite closely. But, as a general rule, Linus + + Documentation/process/2.Process.rst:finding the right maintainer. Sending patches directly to Linus is not + + Documentation/process/2.Process.rst:an appropriate subsystem tree or be sent directly to Linus. In a typical + + Documentation/process/4.Coding.rst:breaks? The best answer to this question was expressed by Linus in July, + + Documentation/process/kernel-enforcement-statement.rst: - Linus Torvalds + + Documentation/process/kernel-enforcement-statement.rst: - Linus Walleij + + Documentation/process/7.AdvancedTopics.rst:when Linus first started playing with the proprietary BitKeeper + + Documentation/process/7.AdvancedTopics.rst:can affect your ability to get trees pulled in the future. Quoting Linus: + + Documentation/process/adding-syscalls.rst: - Collated emails from Linus Torvalds discussing the problems with ``ioctl()``: + + Documentation/process/adding-syscalls.rst: - Recommendation from Linus Torvalds that x32 system calls should prefer + + Documentation/process/embargoed-hardware-issues.rst: - Linus Torvalds (Linux Foundation Fellow) + + Documentation/process/howto.rst: - Linus's mainline tree + + Documentation/process/howto.rst:The mainline tree is maintained by Linus Torvalds, and can be found at + + Documentation/process/howto.rst: Linus, usually the patches that have already been included in the + + Documentation/process/howto.rst: patches to Linus after -rc1 is released, but the patches need to also be + + Documentation/process/howto.rst: - A new -rc is released whenever Linus deems the current git tree to + + Documentation/process/stable-kernel-rules.rst: - It or an equivalent fix must already exist in Linus' tree (upstream). + + Documentation/process/stable-kernel-rules.rst:After the patch has been merged to Linus' tree, send an email to + + Documentation/process/1.Intro.rst:mainline kernel (the "mainline" being the kernel maintained by Linus + + Documentation/process/applying-patches.rst:These are the base stable releases released by Linus. The highest numbered + + Documentation/process/applying-patches.rst:by Linus whenever he deems the current git (the kernel's source management + + Documentation/process/applying-patches.rst:and, during the merge window, sends them directly to Linus. + + Documentation/process/applying-patches.rst:it on to Linus for inclusion in mainline. + + Documentation/process/applying-patches.rst:the more stable mainline Linus tree. + + Documentation/process/applying-patches.rst:Thank you's to Randy Dunlap, Rolf Eike Beer, Linus Torvalds, Bodo Eggert, + + Documentation/process/5.Posting.rst:Linus's git tree. When basing on mainline, start with a well-known release + + Documentation/process/5.Posting.rst:is possible to send patches directly to Linus Torvalds and have him merge + + Documentation/process/5.Posting.rst:them, things are not normally done that way. Linus is busy, and there are + + Documentation/process/6.Followthrough.rst:kernel, nobody has absolute veto power over any code. Except maybe Linus. + + Documentation/process/submitting-patches.rst:Linus Torvalds is the final arbiter of all changes accepted into the + + Documentation/process/submitting-patches.rst:Linus directly, so typically you should do your best to -avoid- + + Documentation/process/submitting-patches.rst:Linus and other kernel developers need to be able to read and comment + + Documentation/process/submitting-patches.rst:code. A MIME attachment also takes Linus a bit more time to process, + + Documentation/process/submitting-patches.rst:Due to high e-mail traffic to Linus, and to linux-kernel, it is common + + Documentation/process/submitting-patches.rst:convention to prefix your subject line with [PATCH]. This lets Linus + + Documentation/process/submitting-patches.rst:as it was propagated to the maintainers and ultimately to Linus, with + + Documentation/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: + + Documentation/process/volatile-considered-harmful.rst: to be a "stupid legacy" issue (Linus's words) in this regard; fixing it + + Documentation/core-api/bus-virt-phys-mapping.rst::Author: Linus + + Documentation/driver-api/usb/dwc3.rst: 1. You're running latest tag from `Linus' tree`_ + + Documentation/driver-api/usb/dwc3.rst:.. _Linus' tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ + + drivers/ata/sata_gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/ata/sata_gemini.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/ata/pata_opti.c: * Copyright (C) 1996-1998 Linus Torvalds & authors (see below) + + drivers/ata/pata_ftide010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/ata/pata_ftide010.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/ata/pata_cmd640.c: * Copyright (C) 1995-1996 Linus Torvalds & authors (see driver) + + drivers/ata/pata_rz1000.c: * Copyright (C) 1995-1998 Linus Torvalds & author (see below) + + drivers/base/pinctrl.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/base/power/trace.c: * Copyright (C) 2006 Linus Torvalds + + Documentation/scsi/scsi_mid_low_api.rst:First, Linus Torvalds's thoughts on C coding style can be found in the + + drivers/scsi/qla1280.c: Rev 3.23.19 Beta April 11, 2002, Linus Torvalds + + drivers/video/fbdev/via/via-core.c: * -- Linus Torvalds, Dec. 7, 2009 + + drivers/video/console/vgacon.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/video/console/sticon.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/video/backlight/ipaq_micro_bl.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/video/console/mdacon.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/video/backlight/ktd253-backlight.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/rtc/rtc-ab8500.c: * Linus Walleij <linus.walleij@stericsson.com> + + drivers/gpio/gpio-gw-pld.c:// Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpio/gpio-gw-pld.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/gpio/gpio-max732x.c: * Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpio/gpio-ftgpio010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/gpio/gpio-ixp4xx.c:// Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> + + drivers/watchdog/ftwdt010_wdt.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/watchdog/ftwdt010_wdt.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/watchdog/ixp4xx_wdt.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/mmc/core/host.c: * Copyright (C) 2010 Linus Walleij + + drivers/iio/light/cm3605.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/light/cm3605.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/iio/light/bh1780.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/light/bh1780.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/iio/light/gp2ap002.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/light/gp2ap002.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/iio/gyro/mpu3050-i2c.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/iio/gyro/mpu3050-core.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/gyro/mpu3050-core.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/iio/pressure/bmp280-core.c: * Copyright (c) 2016 Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/adc/qcom-pm8xxx-xoadc.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/adc/ab8500-gpadc.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/magnetometer/ak8974.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/magnetometer/ak8974.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/iio/magnetometer/yamaha-yas530.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/iio/magnetometer/yamaha-yas530.c:MODULE_AUTHOR("Linus Walleij"); + + drivers/pwm/pwm-stmpe.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/firmware/efi/libstub/string.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/firmware/efi/libstub/vsprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/power/supply/ipaq_micro_battery.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/power/reset/arm-versatile-reboot.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/power/reset/gemini-poweroff.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/leds/leds-syscon.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/leds/flash/leds-rt8515.c: * Linus Walleij <linus.walleij@linaro.org> + + drivers/leds/flash/leds-rt8515.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/leds/leds-ipaq-micro.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/leds/trigger/ledtrig-cpu.c: * Copyright 2011 Linus Walleij <linus.walleij@linaro.org> + + drivers/regulator/stw481x-vmmc.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/regulator/tps6105x-regulator.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/regulator/tps6105x-regulator.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/of/irq.c: * Copyright (C) 1992 Linus Torvalds + + Documentation/kernel-hacking/locking.rst:- ``Documentation/locking/spinlocks.rst``: Linus Torvalds' spinlocking + + Documentation/kernel-hacking/hacking.rst:Linus. + + Documentation/kernel-hacking/hacking.rst:Linus and the other developers sometimes change function or structure + + Documentation/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky + + Documentation/maintainer/pull-requests.rst:and Linus Torvalds on LKML. Suggestions and fixes by Jonathan Corbet and + + Documentation/maintainer/pull-requests.rst:Linus will only accept pull requests based on a signed tag. Other + + Documentation/maintainer/pull-requests.rst:As said by Linus:: + + Documentation/maintainer/pull-requests.rst: Linus + + Documentation/maintainer/pull-requests.rst: branch (which in my case points to the last location in Linus's + + Documentation/maintainer/pull-requests.rst:Linus responded that he tends to prefer the ``git://`` protocol. Other + + Documentation/maintainer/pull-requests.rst:lists if required. Pull requests to Linus typically have a subject line + + Documentation/maintainer/rebasing-and-merging.rst:A frequent cause of merge-window trouble is when Linus is presented with a + + Documentation/maintainer/rebasing-and-merging.rst:for the final pull request: Linus is adamant that he would much rather see + + Documentation/maintainer/rebasing-and-merging.rst:Linus in the pull request that the conflict will happen; if nothing else, + + drivers/tty/n_tty.c: * This file also contains code originally written by Linus Torvalds, + + drivers/pci/controller/pci-v3-semi.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/pci/controller/pci-ftpci100.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/pci/controller/pci-ixp4xx.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/tty/tty_jobctrl.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/tty/tty_ioctl.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + drivers/tty/tty_baudrate.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + drivers/tty/amiserial.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/tty/pty.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/tty/mxser.c: * Linux serial driver, written by Linus Torvalds, Theodore T'so and + + drivers/tty/serial/8250/8250.h: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/8250/8250_port.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/8250/8250_core.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/8250/8250_pnp.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/mux.c: * rmk has already submitted a patch to linus, should be available for + + drivers/tty/serial/8250/8250_pci.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/atmel_serial.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/sa1100.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/imx.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/amba-pl011.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/ar933x_uart.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/amba-pl010.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/clps711x.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/lantiq.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/serial/serial_core.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. + + drivers/tty/moxa.c: * Linus Torvalds, Theodore T'so and others. + + drivers/tty/tty_io.c: * Copyright (C) 1991, 1992 Linus Torvalds + + drivers/tty/vt/keyboard.c: * the assembly version by Linus (with diacriticals added) + + drivers/tty/vt/vt.c: * Copyright (C) 1991, 1992 Linus Torvalds + + Documentation/x86/exception-tables.rst:To overcome this situation, Linus decided to let the virtual memory + + Documentation/bpf/bpf_devel_QA.rst:into the kernel mainline tree run by Linus Torvalds. To read up on the + + Documentation/bpf/bpf_devel_QA.rst:your patch series once bpf-next is open again. Once Linus released + + drivers/input/mouse/amimouse.c: * Nathan Laredo Linus Torvalds + + drivers/input/mouse/gpio_mouse.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/input/mouse/logibm.c: * Linus Torvalds Johan Myreen + + drivers/input/keyboard/ipaq-micro-keys.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/input/keyboard/dlink-dir685-touchkeys.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/input/keyboard/dlink-dir685-touchkeys.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + Documentation/admin-guide/README.rst: Linus Torvalds with assistance from a loosely-knit team of hackers across + + Documentation/admin-guide/bug-hunting.rst:In order to help Linus and the other kernel developers there has been + + Documentation/admin-guide/reporting-issues.rst:Linus Torvalds and the leading Linux kernel developers want to see some issues + + Documentation/admin-guide/reporting-issues.rst:Linux lead developer Linus Torvalds insists that the Linux kernel never + + Documentation/admin-guide/reporting-issues.rst:it's okay to get Linus Torvalds involved. + + Documentation/admin-guide/reporting-issues.rst:to get resolved. The maintainers or if all else fails Linus Torvalds himself + + drivers/input/touchscreen/ipaq-micro-ts.c: * Author : Linus Walleij <linus.walleij@linaro.org> + + drivers/input/touchscreen/cy8ctma140.c: * (C) 2020 Linus Walleij <linus.walleij@linaro.org> + + drivers/input/touchscreen/cy8ctma140.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + Documentation/power/s2ram.rst:2006 Linus Torvalds + + Documentation/power/s2ram.rst:3) You can use Linus' TRACE_RESUME infrastructure, described below. + + Documentation/power/freezing-of-tasks.rst:Although Linus Torvalds doesn't like the freezing of tasks, he said this in one + + Documentation/power/freezing-of-tasks.rst:Linus: In many ways, 'at all'. + + Documentation/dev-tools/sparse.rst:.. Copyright 2004 Linus Torvalds + + Documentation/crypto/api-intro.rst: - Linus Torvalds (i586) + + Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/mtd/partitions/redboot-fis.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/arm,versatile.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/bus/arm,integrator-ap-lm.yaml: - Linus Walleij <linusw@kernel.org> + + Documentation/devicetree/bindings/bus/intel,ixp4xx-expansion-bus-controller.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/arm,integrator.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/spi/spi-pl022.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/arm,scu.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/gemini.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/arm,realview.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/arm/ux500.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/pinctrl/pinmux-node.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/ata/pata-common.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/ata/intel,ixp4xx-compact-flash.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/ata/sata-common.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/ata/faraday,ftide010.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/pinctrl/pinctrl.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/rtc/faraday,ftrtc010.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/mmc/arm,pl18x.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/st,st-sensors.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/gpio/pl061-gpio.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/extcon/fcs,fsa880.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/clock/stericsson,u8500-clks.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/filesystems/path-lookup.rst:The second reason was `outlined recently`_ by Linus: + + Documentation/filesystems/dlmfs.rst:Some code taken from ramfs which is Copyright |copy| 2000 Linus Torvalds + + Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml: - Linus Walleij <linusw@kernel.org> + + Documentation/devicetree/bindings/pci/faraday,ftpci100.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/leds/richtek,rt8515.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/leds/register-bit-led.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/auxdisplay/arm,versatile-lcd.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/leds/backlight/kinetic,ktd253.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/power/supply/samsung,battery.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/process/1.Intro.rst:s'intende quello mantenuto da Linus Torvalds e usato come base dai + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:potrete auto-recuperare le chiavi di Linus Torvalds e Greg Kroah-Hartman + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:``C94035C21B4F2AEB``. Ora visualizzate le chiavi di Linus Torvalds + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst: uid [ unknown] Linus Torvalds <torvalds@kernel.org> + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:digitale della chiave di Linus Torvalds che si vede nell'output qui sopra. + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:- `Finding paths to Linus`_ + + Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:.. _`Finding paths to Linus`: https://pgp.cs.uu.nl/paths/79BE3E4300411886/to/C94035C21B4F2AEB.html + + Documentation/translations/it_IT/process/2.Process.rst:Al termine di questo periodo, Linus Torvald dichiarerà che la finestra è + + Documentation/translations/it_IT/process/2.Process.rst:il ritmo delle modifiche rallenta col tempo. Linus rilascia un nuovo + + Documentation/translations/it_IT/process/2.Process.rst: Linus Torvalds. In questa fase potrebbero emergere nuovi problemi e/o + + Documentation/translations/it_IT/process/2.Process.rst:del kernel: Linus Torvalds. Ma, per esempio, di tutte le 9500 patch + + Documentation/translations/it_IT/process/2.Process.rst:l'1,3%) furono scelte direttamente da Linus in persona. Il progetto + + Documentation/translations/it_IT/process/2.Process.rst:chiederanno a Linus di "prendere" dai loro repositori le modifiche che hanno + + Documentation/translations/it_IT/process/2.Process.rst:selezionato per l'inclusione. Se Linus acconsente, il flusso di patch si + + Documentation/translations/it_IT/process/2.Process.rst:principale del kernel. La quantità d'attenzione che Linus presta alle + + Documentation/translations/it_IT/process/2.Process.rst:generale, Linus confida nel fatto che i manutentori di sottosistema non + + Documentation/translations/it_IT/process/2.Process.rst:patch direttamente a Linus non è la via giusta. + + Documentation/translations/it_IT/process/2.Process.rst:direttamente a Linus. In un tipico ciclo di sviluppo, circa il 5-10% delle + + Documentation/translations/it_IT/process/volatile-considered-harmful.rst: (parole di Linus) in questo contesto; correggerla non ne varrebbe la pena e + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/771c035372a036f83353eef46dbb829780330234>`_ + + Documentation/translations/it_IT/process/deprecated.rst:circa l'errore. Linus ha un'opinione molto critica al riguardo: + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/d4689846881d160a4d12a514e991a740bcb5d65a>`_) + + Documentation/translations/it_IT/process/deprecated.rst:di Linus: + + Documentation/translations/it_IT/process/deprecated.rst: affrontare il giudizio di Linus, allora forse potrai usare "%px", + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/5ead723a20e0447bc7db33dc3070b420e5f80aa6>`_" alla + + Documentation/translations/it_IT/process/deprecated.rst:vettori a dimensione fissa. Questi `problemi di prestazioni <https://git.kernel.org/linus/02361bc77888>`_, + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/76497732932f15e7323dc805e8ea8dc11bb587cf>`_. + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/f2cd32a443da694ac4e28fbf4ac6f9d5cc63a539>`_, + + Documentation/translations/it_IT/process/deprecated.rst:<https://git.kernel.org/linus/ab91c2a89f86be2898cee208d492816ec238b2cf>`_. + + Documentation/translations/it_IT/process/6.Followthrough.rst:fatta per Linus, forse. + + Documentation/devicetree/bindings/input/atmel,maxtouch.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/process/5.Posting.rst:così come lo si trova nei sorgenti git di Linus. Quando vi basate sul ramo + + Documentation/translations/it_IT/process/5.Posting.rst:Linus Torvalds, e lasciare che sia lui ad integrarle,solitamente non è la + + Documentation/translations/it_IT/process/5.Posting.rst:strada migliore da seguire. Linus è occupato, e ci sono dei manutentori di + + Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma140.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/process/kernel-enforcement-statement.rst: - Linus Torvalds + + Documentation/translations/it_IT/process/kernel-enforcement-statement.rst: - Linus Walleij + + Documentation/translations/it_IT/process/howto.rst:I kernel 4.x sono amministrati da Linus Torvald, e possono essere trovati + + Documentation/translations/it_IT/process/howto.rst: settimane. Durante questo periodo i manutentori possono proporre a Linus + + Documentation/translations/it_IT/process/howto.rst: aggiunto. git può essere utilizzato per inviare le patch a Linus dopo che + + Documentation/translations/it_IT/process/howto.rst: - Una nuova -rc viene rilasciata ogni volta che Linus reputa che gli attuali + + Documentation/translations/it_IT/process/submitting-patches.rst:Linus e gli altri sviluppatori del kernel devono poter commentare + + Documentation/translations/it_IT/process/submitting-patches.rst:Inoltre, un allegato MIME rende l'attività di Linus più laboriosa, diminuendo + + Documentation/translations/it_IT/process/submitting-patches.rst:Dato l'alto volume di e-mail per Linus, e la lista linux-kernel, è prassi + + Documentation/translations/it_IT/process/submitting-patches.rst:prefiggere il vostro oggetto con [PATCH]. Questo permette a Linus e agli + + Documentation/translations/it_IT/process/submitting-patches.rst:manutentore, per poi giungere a Linus. + + Documentation/translations/it_IT/process/submitting-patches.rst:E-mail di Linus Torvalds sul formato canonico di una patch: + + Documentation/translations/it_IT/process/adding-syscalls.rst: - Raccomandazioni da Linus Torvalds che le chiamate di sistema x32 dovrebbero + + Documentation/devicetree/bindings/display/ste,mcde.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/faraday,tve200.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/process/7.AdvancedTopics.rst:vostri rami. Citando Linus + + Documentation/devicetree/bindings/net/intel,ixp4xx-hss.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/net/intel,ixp4xx-ethernet.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/sony,acx424akp.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/input/touchscreen/melfas,mms114.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/ti,nspire.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/process/4.Coding.rst:domanda ci è stata fornita da Linus nel luglio 2007: + + Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/dsi-controller.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/kernel-hacking/hacking.rst:che questo venga accettato da Linus. + + Documentation/translations/it_IT/kernel-hacking/hacking.rst:Linus e gli altri sviluppatori a volte cambiano i nomi delle funzioni e + + Documentation/translations/it_IT/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky + + Documentation/devicetree/bindings/display/panel/ilitek,ili9322.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/devicetree/bindings/display/panel/samsung,s6d16d0.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/ja_JP/stable_kernel_rules.txt: - パッチ自体か同等の修正が Linus のツリーに既に存在しなければならない。 + + Documentation/translations/ja_JP/stable_kernel_rules.txt:  Linus のツリーでのコミットID を -stable へのパッチ投稿の際に引用す + + Documentation/translations/ja_JP/stable_kernel_rules.txt: が Linus のツリーに入る時に自動的に stable チームに email される。 + + Documentation/translations/ko_KR/howto.rst:메인라인 트리는 Linus Torvalds가 관리하며 https://kernel.org 또는 소스 + + Documentation/translations/ko_KR/howto.rst: 메인테이너들은 큰 diff들을 Linus에게 제출할 수 있다. 대개 이 패치들은 + + Documentation/translations/ko_KR/howto.rst: 있지 않기 때문이다. -rc1이 배포된 이후에 git를 사용하여 패치들을 Linus에게 + + Documentation/translations/ko_KR/howto.rst: - 새로운 -rc는 Linus가 현재 git tree가 테스트 하기에 충분히 안정된 상태에 + + Documentation/translations/zh_TW/gpio.txt: Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/zh_TW/gpio.txt: Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/zh_TW/admin-guide/bug-hunting.rst:爲了幫助Linus和其他內核開發人員, ``klogd`` 對保護故障的處理提供了大量支持。 + + Documentation/devicetree/bindings/display/panel/samsung,lms380kf01.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/it_IT/kernel-hacking/locking.rst:- ``Documentation/locking/spinlocks.rst``: la guida di Linus Torvalds agli + + Documentation/translations/zh_TW/process/4.Coding.rst:Linus對這個問題給出了最佳答案: + + Documentation/translations/zh_TW/process/volatile-considered-harmful.rst: (Linus的話)因爲解決這個問題比保持現狀要麻煩的多。 + + Documentation/devicetree/bindings/display/panel/tpo,tpg110.yaml: - Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/zh_TW/process/7.AdvancedTopics.rst:內核使用分布式版本控制始於2002年初,當時Linus首次開始使用專有的Bitkeeper應用 + + Documentation/translations/zh_TW/process/7.AdvancedTopics.rst:主題外的補丁可能會影響您將來讓樹被拉取的能力。引用Linus的話: + + Documentation/translations/zh_TW/process/kernel-enforcement-statement.rst: - Linus Torvalds + + Documentation/translations/zh_TW/process/kernel-enforcement-statement.rst: - Linus Walleij + + Documentation/translations/zh_TW/process/howto.rst: - Linus 的內核源碼樹 + + Documentation/translations/zh_TW/process/howto.rst:主線樹是由Linus Torvalds 維護的。你可以在https://kernel.org 網站或者代碼 + + Documentation/translations/zh_TW/process/howto.rst: 維護者可以向Linus提交大段的修改,通常這些修改已經被放到-mm內核中幾個 + + Documentation/translations/zh_TW/process/howto.rst: 沒有造成內核退步的風險。在-rc1以後也可以用git向Linus提交補丁,不過所 + + Documentation/translations/zh_TW/process/howto.rst: - 當Linus認爲當前的git源碼樹已經達到一個合理健全的狀態足以發布供人測試 + + Documentation/translations/zh_TW/sparse.txt:Copyright 2004 Linus Torvalds + + Documentation/translations/zh_TW/process/embargoed-hardware-issues.rst: - Linus Torvalds(Linux基金會院士) + + Documentation/translations/ja_JP/SubmittingPatches: かの Linus Torvalds の取り扱い説明書 + + Documentation/translations/ja_JP/SubmittingPatches:Linus Torvalds は Linux カーネルに入る全ての変更に対する最終的な意思決定者 + + Documentation/translations/ja_JP/SubmittingPatches:必要としないパッチは Linus へ電子メールを送るか CC しなければなりません。 + + Documentation/translations/ja_JP/SubmittingPatches:Linus へ送るべきです。 + + Documentation/translations/ja_JP/SubmittingPatches:Linus 以外のカーネル開発者は変更に気づく必要があり、その結果、彼らはそ + + Documentation/translations/ja_JP/SubmittingPatches:Linus や他のカーネル開発者はあなたが投稿した変更を読んで、コメントでき + + Documentation/translations/ja_JP/SubmittingPatches:MIME 形式の添付ファイルは Linus に手間を取らせることになり、その変更を + + Documentation/translations/ja_JP/SubmittingPatches:パッチを Linus へ送るときは常に #7 の手順に従ってください。 + + Documentation/translations/ja_JP/SubmittingPatches:パッチが最新バージョンのカーネルに正しく適用できなければ、Linus + + Documentation/translations/ja_JP/SubmittingPatches:パッチを投稿した後は、辛抱強く待っていてください。Linus があなたのパッ + + Documentation/translations/ja_JP/SubmittingPatches:チを気に入って採用すれば、Linus がリリースする次のバージョンのカーネル + + Documentation/translations/ja_JP/SubmittingPatches:Linus があなたのパッチに対して何のコメントもなく不採用にすることは極め + + Documentation/translations/ja_JP/SubmittingPatches:て普通のことです。それは自然な姿です。もし、Linus があなたのパッチを受 + + Documentation/translations/ja_JP/SubmittingPatches:* Linus はたくさんの電子メールを受け取っているので、どさくさに紛れて見 + + Documentation/translations/ja_JP/SubmittingPatches:Linus や LKML への大量の電子メールのために、サブジェクトのプレフィックスに + + Documentation/translations/ja_JP/SubmittingPatches:「 [PATCH] 」を付けることが慣習となっています。これによって Linus や他の + + Documentation/translations/ja_JP/SubmittingPatches:16) 「git pull」要求の送り方(Linus の電子メールから) + + Documentation/translations/ja_JP/SubmittingPatches: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus + + Documentation/translations/ja_JP/SubmittingPatches:セクションを Linus のコンピュータ・サイエンス101と呼ぶでしょう。 + + Documentation/translations/ja_JP/SubmittingPatches:Linus Torvalds's mail on the canonical patch format: + + Documentation/translations/zh_CN/process/1.Intro.rst:放入主线内核(“主线”是由Linus Torvalds维护的内核,Linux发行商将其用作基础)。 + + Documentation/translations/zh_CN/process/2.Process.rst:合并窗口持续大约两周。在这段时间结束时,Linus Torvalds将声明窗口已关闭,并 + + Documentation/translations/zh_CN/process/2.Process.rst:随着修复程序进入主线,补丁速度将随着时间的推移而变慢。Linus大约每周发布一次 + + Documentation/translations/zh_CN/process/2.Process.rst:- 合并到主线。最终,一个成功的补丁将被合并到由LinusTorvalds管理的主线存储库 + + Documentation/translations/zh_CN/process/2.Process.rst:只有一个人可以将补丁合并到主线内核存储库中:Linus Torvalds。但是,在进入 + + Documentation/translations/zh_CN/process/2.Process.rst:2.6.38内核的9500多个补丁中,只有112个(大约1.3%)是由Linus自己直接选择的。 + + Documentation/translations/zh_CN/process/2.Process.rst:当合并窗口打开时,顶级维护人员将要求Linus从存储库中“拉出”他们为合并选择 + + Documentation/translations/zh_CN/process/2.Process.rst:的补丁。如果Linus同意,补丁流将流向他的存储库,成为主线内核的一部分。 + + Documentation/translations/zh_CN/process/2.Process.rst:Linus对拉取中接收到的特定补丁的关注程度各不相同。很明显,有时他看起来很 + + Documentation/translations/zh_CN/process/2.Process.rst:关注。但是一般来说,Linus相信子系统维护人员不会向上游发送坏补丁。 + + Documentation/translations/zh_CN/process/2.Process.rst:显然,在这样的系统中,获取内核补丁取决于找到正确的维护者。直接向Linus发送 + + Documentation/translations/zh_CN/process/2.Process.rst:发送到Linus。在典型的开发周期中,大约5-10%的补丁通过-mm 进入主线。 + + Documentation/translations/zh_TW/process/submitting-patches.rst:Linus Torvalds 是決定改動能否進入 Linux 內核的最終裁決者。他的 e-mail + + Documentation/translations/zh_TW/process/submitting-patches.rst:Linus 和其他的內核開發者需要閱讀和評論你提交的改動。對於內核開發者來說 + + Documentation/translations/zh_TW/process/submitting-patches.rst:代碼中加評論。另外,MIME 編碼的附件會讓 Linus 多花一點時間來處理,這就 + + Documentation/translations/zh_TW/process/submitting-patches.rst:由於到linus和linux內核的電子郵件流量很高,通常會在主題行前面加上[PATCH] + + Documentation/translations/zh_TW/process/submitting-patches.rst:前綴. 這使Linus和其他內核開發人員更容易將補丁與其他電子郵件討論區分開。 + + Documentation/translations/zh_TW/process/submitting-patches.rst: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus + + Documentation/translations/zh_TW/process/submitting-patches.rst:一些維護人員(包括Linus)希望看到來自已簽名提交的請求;這增加了他們對你的 + + Documentation/translations/zh_TW/process/submitting-patches.rst:請求信心。特別是,在沒有簽名標籤的情況下,Linus 不會從像 Github 這樣的公共 + + Documentation/translations/zh_TW/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: + + Documentation/translations/zh_CN/process/6.Followthrough.rst:了Linus + + Documentation/translations/zh_CN/process/7.AdvancedTopics.rst:内核使用分布式版本控制始于2002年初,当时Linus首次开始使用专有的Bitkeeper应用 + + Documentation/translations/zh_CN/process/7.AdvancedTopics.rst:主题外的补丁可能会影响您将来让树被拉取的能力。引用Linus的话: + + Documentation/translations/zh_CN/process/5.Posting.rst:必须针对内核的特定版本准备补丁。一般来说,补丁应该基于Linus的Git树中的当前 + + Documentation/translations/zh_CN/process/5.Posting.rst:可以将补丁直接发给Linus Torvalds并让他合并,但通常情况下不会这样做。Linus + + Documentation/translations/zh_TW/process/5.Posting.rst:必須針對內核的特定版本準備補丁。一般來說,補丁應該基於Linus的Git樹中的當前 + + Documentation/translations/zh_TW/process/5.Posting.rst:可以將補丁直接發給Linus Torvalds並讓他合併,但通常情況下不會這樣做。Linus + + Documentation/translations/zh_TW/process/stable-api-nonsense.rst:你這個吸血鬼<把Andrew和Linus對吸血鬼的定義連結到這裡>)。當你的代碼加入 + + Documentation/translations/zh_TW/admin-guide/README.rst: Linux是Unix作業系統的克隆版本,由Linus Torvalds在一個鬆散的網絡黑客 + + Documentation/translations/zh_CN/process/volatile-considered-harmful.rst: (Linus的话)因为解决这个问题比保持现状要麻烦的多。 + + Documentation/translations/zh_CN/process/4.Coding.rst:Linus对这个问题给出了最佳答案: + + Documentation/translations/zh_TW/process/2.Process.rst:合併窗口持續大約兩周。在這段時間結束時,LinusTorvalds將聲明窗口已關閉,並 + + Documentation/translations/zh_TW/process/2.Process.rst:隨著修復程序進入主線,補丁速度將隨著時間的推移而變慢。Linus大約每周發布一次 + + Documentation/translations/zh_TW/process/2.Process.rst:- 合併到主線。最終,一個成功的補丁將被合併到由LinusTorvalds管理的主線存儲庫 + + Documentation/translations/zh_TW/process/2.Process.rst:只有一個人可以將補丁合併到主線內核存儲庫中:LinusTorvalds。但是,在進入 + + Documentation/translations/zh_TW/process/2.Process.rst:2.6.38內核的9500多個補丁中,只有112個(大約1.3%)是由Linus自己直接選擇的。 + + Documentation/translations/zh_TW/process/2.Process.rst:當合併窗口打開時,頂級維護人員將要求Linus從存儲庫中「拉出」他們爲合併選擇 + + Documentation/translations/zh_TW/process/2.Process.rst:的補丁。如果Linus同意,補丁流將流向他的存儲庫,成爲主線內核的一部分。 + + Documentation/translations/zh_TW/process/2.Process.rst:Linus對拉取中接收到的特定補丁的關注程度各不相同。很明顯,有時他看起來很 + + Documentation/translations/zh_TW/process/2.Process.rst:關注。但是一般來說,Linus相信子系統維護人員不會向上游發送壞補丁。 + + Documentation/translations/zh_TW/process/2.Process.rst:顯然,在這樣的系統中,獲取內核補丁取決於找到正確的維護者。直接向Linus發送 + + Documentation/translations/zh_TW/process/2.Process.rst:發送到Linus。在典型的開發周期中,大約5-10%的補丁通過-mm 進入主線。 + + Documentation/translations/zh_CN/process/stable-api-nonsense.rst:你这个吸血鬼<把Andrew和Linus对吸血鬼的定义链接到这里>)。当你的代码加入 + + Documentation/translations/zh_CN/process/kernel-enforcement-statement.rst: - Linus Torvalds + + Documentation/translations/zh_CN/process/kernel-enforcement-statement.rst: - Linus Walleij + + Documentation/translations/zh_CN/process/submitting-patches.rst:Linus Torvalds 是决定改动能否进入 Linux 内核的最终裁决者。他的 e-mail + + Documentation/translations/zh_CN/process/submitting-patches.rst:Linus 和其他的内核开发者需要阅读和评论你提交的改动。对于内核开发者来说 + + Documentation/translations/zh_CN/process/submitting-patches.rst:代码中加评论。另外,MIME 编码的附件会让 Linus 多花一点时间来处理,这就 + + Documentation/translations/zh_CN/process/submitting-patches.rst:由于到linus和linux内核的电子邮件流量很高,通常会在主题行前面加上[PATCH] + + Documentation/translations/zh_CN/process/submitting-patches.rst:前缀. 这使Linus和其他内核开发人员更容易将补丁与其他电子邮件讨论区分开。 + + Documentation/translations/zh_CN/process/submitting-patches.rst: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus + + Documentation/translations/zh_CN/process/submitting-patches.rst:一些维护人员(包括Linus)希望看到来自已签名提交的请求;这增加了他们对你的 + + Documentation/translations/zh_CN/process/submitting-patches.rst:请求信心。特别是,在没有签名标签的情况下,Linus 不会从像 Github 这样的公共 + + Documentation/translations/zh_CN/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: + + Documentation/translations/zh_CN/process/howto.rst: - Linus 的内核源码树 + + Documentation/translations/zh_CN/process/howto.rst:主线树是由Linus Torvalds 维护的。你可以在https://kernel.org 网站或者代码 + + Documentation/translations/zh_CN/process/howto.rst: 维护者可以向Linus提交大段的修改,通常这些修改已经被放到-mm内核中几个 + + Documentation/translations/zh_CN/process/howto.rst: 没有造成内核退步的风险。在-rc1以后也可以用git向Linus提交补丁,不过所 + + Documentation/translations/zh_CN/process/howto.rst: - 当Linus认为当前的git源码树已经达到一个合理健全的状态足以发布供人测试 + + Documentation/translations/zh_TW/process/1.Intro.rst:放入主線內核(「主線」是由Linus Torvalds維護的內核,Linux發行商將其用作基礎)。 + + Documentation/translations/zh_CN/process/embargoed-hardware-issues.rst: - Linus Torvalds(Linux基金会院士) + + Documentation/translations/zh_CN/kernel-hacking/hacking.rst:``include/asm/unistd.h`` 和 ``arch/kernel/entry.S`` 文件里,而且更容易被Linus + + Documentation/translations/zh_CN/kernel-hacking/hacking.rst:Linus和其他开发人员有时会更改开发内核中的函数或结构体名称;这样做不仅是为了 + + Documentation/translations/zh_CN/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky + + Documentation/translations/zh_TW/process/6.Followthrough.rst:了Linus + + Documentation/translations/zh_CN/oops-tracing.txt:注意:以下来自于Linus的邮件适用于2.4内核。 我因为历史原因保留了它,并且因为其中 + + Documentation/translations/zh_CN/oops-tracing.txt:From: Linus Torvalds <torvalds@osdl.org> + + Documentation/translations/zh_CN/oops-tracing.txt: Linus + + Documentation/translations/zh_CN/oops-tracing.txt:为了帮助Linus和其它内核开发者,klogd纳入了大量的支持来处理保护错误。为了拥有对 + + Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:Linus Torvalds和主要的Linux內核開發人員希望看到一些問題儘快得到解決,因此在 + + Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:Linux 首席開發者 Linus Torvalds 認爲 Linux 內核永遠不應惡化,這就是爲什麼他 + + Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:這可能是一種罕見的、可以讓 Linus Torvalds 參與進來的情況。 + + Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:重問題)才一定會得到解決。如果維護者或其他人都失敗了,Linus Torvalds 他自己 + + Documentation/translations/zh_CN/admin-guide/README.rst: Linux是Unix操作系统的克隆版本,由Linus Torvalds在一个松散的网络黑客 + + Documentation/translations/zh_CN/gpio.txt: Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/zh_CN/gpio.txt: Linus Walleij <linus.walleij@linaro.org> + + Documentation/translations/ja_JP/howto.rst:4.x カーネルは Linus Torvalds によってメンテナンスされ、 + + Documentation/translations/ja_JP/howto.rst: この期間中に、メンテナ達は Linus に大きな差分を送ることができます。 + + Documentation/translations/ja_JP/howto.rst: Linus へパッチを送付するのに git を使うこともできますが、パッチは + + Documentation/translations/ja_JP/howto.rst: - 新しい -rc は Linus が、最新の git ツリーがテスト目的であれば十分 + + Documentation/translations/zh_CN/maintainer/pull-requests.rst:来自Greg Kroah Hartman和Linus Torvalds在LKML上的评论。Jonathan Corbet和Mauro + + Documentation/translations/zh_CN/maintainer/pull-requests.rst:Linus只接受基于签名过的标记的拉取请求。其他维护者可能会有所不同。 + + Documentation/translations/zh_CN/maintainer/pull-requests.rst:正如Linus所说:: + + Documentation/translations/zh_CN/maintainer/pull-requests.rst: Linus + + Documentation/translations/zh_CN/maintainer/pull-requests.rst: 例子中指向了我从Linus的树分叉的地方,通常是-rc发布)的差异,并去使用 + + Documentation/translations/zh_CN/maintainer/pull-requests.rst:Linus回复说他倾向于 ``git://`` 协议。其他维护者可能有不同的偏好。另外,请注意 + + Documentation/translations/zh_CN/maintainer/pull-requests.rst:任何必要特定子系统的列表。对Linus的拉取请求通常有如下主题行:: + + Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:合并窗口麻烦的一个常见原因是,Linus收到了一个明显在拉取请求发送之前不久才变根 + + Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:尤其如此:Linus坚信他更愿意看到合并冲突,而不是不必要的反向合并。看到冲突 + + Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:的一步是在拉取请求中提示Linus会发生冲突;如果啥都没说则表明您的分支可以正常 + + Documentation/translations/zh_TW/oops-tracing.txt:注意:以下來自於Linus的郵件適用於2.4內核。 我因爲歷史原因保留了它,並且因爲其中 + + Documentation/translations/zh_TW/oops-tracing.txt:From: Linus Torvalds <torvalds@osdl.org> + + Documentation/translations/zh_TW/oops-tracing.txt: Linus + + Documentation/translations/zh_TW/oops-tracing.txt:爲了幫助Linus和其它內核開發者,klogd納入了大量的支持來處理保護錯誤。爲了擁有對 + + Documentation/translations/zh_CN/dev-tools/sparse.rst:Copyright 2004 Linus Torvalds + + Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:Linus Torvalds和主要的Linux内核开发人员希望看到一些问题尽快得到解决,因此在 + + Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:Linux 首席开发者 Linus Torvalds 认为 Linux 内核永远不应恶化,这就是为什么他 + + Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:这可能是一种罕见的、可以让 Linus Torvalds 参与进来的情况。 + + Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:重问题)才一定会得到解决。如果维护者或其他人都失败了,Linus Torvalds 他自己 + + Documentation/translations/ja_JP/stable_api_nonsense.txt:と Linus からのコメント<Andrew と Linus のコメントへのリンクをこ + + Documentation/translations/zh_CN/admin-guide/bug-hunting.rst:为了帮助Linus和其他内核开发人员, ``klogd`` 对保护故障的处理提供了大量支持。 + + drivers/clk/clk-gemini.c: * Copyright (c) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/clk/clk-nomadik.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/net/ethernet/cortina/gemini.h: * Copytight (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/net/ethernet/cortina/gemini.c: * Linus Walleij <linus.walleij@linaro.org> + + drivers/net/ethernet/cortina/gemini.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/net/dsa/vitesse-vsc73xx-spi.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> + + drivers/net/dsa/vitesse-vsc73xx-spi.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/net/dsa/vitesse-vsc73xx-platform.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> + + drivers/net/dsa/realtek-smi-core.h: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/net/dsa/realtek-smi-core.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/net/dsa/rtl8366.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/net/dsa/vitesse-vsc73xx-core.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> + + drivers/net/dsa/vitesse-vsc73xx-core.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); + + drivers/clk/versatile/clk-impd1.c: * Copyright (C) 2012-2013 Linus Walleij + + drivers/clk/versatile/clk-impd1.c:MODULE_AUTHOR("Linus Walleij <linusw@kernel.org>"); + + drivers/clk/versatile/clk-versatile.c: * Copyright (C) 2012 Linus Walleij + + drivers/net/dsa/rtl8366rb.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/clk/versatile/clk-icst.c: * Copyright (C) 2012-2015 Linus Walleij + + drivers/net/hamradio/baycom_ser_fdx.c: * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall + + drivers/net/hamradio/baycom_epp.c: * 0.5 03.08.1999 adapt to Linus' new __setup/__initcall + + drivers/net/hamradio/baycom_ser_hdx.c: * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall + + drivers/net/hamradio/baycom_par.c: * 0.6 03.08.1999 adapt to Linus' new __setup/__initcall + + drivers/net/sb1000.c: Linus changed the timer interface. Should work on all recent + + drivers/clk/ux500/reset-prcc.c: * Copyright (C) 2021 Linus Walleij <linus.walleij@linaro.org> + + drivers/soc/versatile/soc-realview.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/soc/versatile/soc-integrator.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/soc/gemini/soc-gemini.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + drivers/clocksource/nomadik-mtu.c: * Copyright (C) 2010 Linus Walleij for ST-Ericsson + + include/asm-generic/tlb.h: * Based on code from mm/memory.c Copyright Linus Torvalds and others. + + drivers/clocksource/timer-fttmr010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> + + drivers/clocksource/timer-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> + + drivers/clocksource/clksrc-dbx500-prcmu.c: * plat-nomadik/timer.c Linus Walleij <linus.walleij@stericsson.com> + + fs/bfs/inode.c: * From fs/minix, Copyright (C) 1991, 1992 Linus Torvalds. + + fs/ext2/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/inode.c: * Linus? + + fs/hugetlbfs/inode.c: * Copyright (C) 2002 Linus Torvalds. + + arch/x86/kernel/irq_64.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/x86/kernel/irq_32.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/x86/kernel/dumpstack_32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/kernel/process_64.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/kernel/dumpstack.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/dumpstack.c: * There are a couple of reasons for the 2/3rd prologue, courtesy of Linus: + + arch/x86/kernel/process_32.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/kernel/head_32.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/time.c: * Copyright (c) 1991,1992,1995 Linus Torvalds + + arch/x86/kernel/vm86_32.c: * Copyright (C) 1994 Linus Torvalds + + arch/x86/kernel/fpu/core.c: * Copyright (C) 1994 Linus Torvalds + + arch/x86/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/cpu/bugs.c: * Copyright (C) 1994 Linus Torvalds + + arch/x86/kernel/ioport.c: * by Linus. 32/64 bits code unification by Miguel Botón. + + arch/x86/kernel/nmi.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/dumpstack_64.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/kernel/ldt.c: * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds + + arch/x86/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/math-emu/README:the original Linux math emulator by Linus Torvalds. + + arch/x86/math-emu/README: [ Linus' note: I changed look-ahead to be the default under linux, as + + arch/x86/math-emu/README:Linus Torvalds + + arch/x86/math-emu/fpu_entry.c: Changes to support them provided by Linus Torvalds. */ + + net/batman-adv/bat_v.h: * Marek Lindner, Linus Lüssing + + net/batman-adv/bat_v.c: * Linus Lüssing, Marek Lindner + + net/batman-adv/multicast.h: * Linus Lüssing + + net/batman-adv/multicast.c: * Linus Lüssing + + net/batman-adv/bat_v_elp.h: * Linus Lüssing, Marek Lindner + + net/batman-adv/bat_v_elp.c: * Linus Lüssing, Marek Lindner + + net/batman-adv/bat_algo.h: * Marek Lindner, Linus Lüssing + + fs/ext2/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/ext2.h: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext2/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/boot.h: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/tty.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/string.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/video-bios.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/main.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/x86/boot/a20.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/tools/build.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/x86/boot/video.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/header.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/video-vesa.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/video-mode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/printf.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/bitops.h: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/pmjump.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/memory.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/video-vga.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/version.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/copy.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/cpu.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/video.h: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/pm.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/cpucheck.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/edd.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/apm.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/cmdline.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/boot/compressed/head_32.S: * Copyright (C) 1991, 1992, 1993 Linus Torvalds + + arch/x86/boot/compressed/head_64.S: * Copyright (C) 1991, 1992, 1993 Linus Torvalds + + arch/x86/lib/usercopy_64.c: * Copyright 1997 Linus Torvalds + + arch/x86/lib/delay.c: * Copyright (C) 1993 Linus Torvalds + + arch/x86/lib/getuser.S: * (C) Copyright 1998 Linus Torvalds + + arch/x86/lib/usercopy_32.c: * Copyright 1997 Linus Torvalds + + arch/x86/lib/putuser.S: * (C) Copyright 2005 Linus Torvalds + + arch/x86/ia32/ia32_aout.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds + + arch/x86/ia32/ia32_signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/entry/entry_32.S: * Copyright (C) 1991,1992 Linus Torvalds + + arch/x86/entry/entry_64.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/include/asm/hw_irq.h: * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar + + arch/x86/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. + + arch/x86/include/asm/io.h: * Linus + + arch/x86/include/asm/sync_bitops.h: * Copyright 1992, Linus Torvalds. + + arch/x86/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/x86/include/asm/irq.h: * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar + + arch/x86/include/asm/stacktrace.h: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/x86/include/asm/fpu/api.h: * Copyright (C) 1994 Linus Torvalds + + arch/x86/include/uapi/asm/vm86.h: * Linus + + arch/x86/realmode/rm/trampoline_64.S: * Trampoline.S Derived from Setup.S by Linus Torvalds + + arch/x86/realmode/rm/trampoline_32.S: * Trampoline.S Derived from Setup.S by Linus Torvalds + + arch/x86/entry/vdso/vdso32-setup.c: * (C) Copyright 2002 Linus Torvalds + + arch/x86/mm/init_64.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/mm/tlb.c: * c/o Linus Torvalds. + + arch/x86/mm/init_32.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/x86/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + fs/hfs/inode.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds + + fs/hfs/catalog.c: * linux/fs/inode.c Copyright (C) 1991, 1992 Linus Torvalds + + fs/hfs/catalog.c: * re-shamelessly stolen Copyright (C) 1997 Linus Torvalds + + fs/hfs/super.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds + + fs/hfs/dir.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds + + fs/buffer.c: * Copyright (C) 1991, 1992, 2002 Linus Torvalds + + fs/open.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/nfs/dir.c: * Following Linus comments on my original hack, this version + + fs/nfs/read.c: * Partial copy of Linus' read cache modifications to fs/nfs/file.c + + fs/nfs/file.c: * Total rewrite of read side for new NFS buffer cache.. Linus. + + fs/nfs/nfsroot.c: * Linus so that I don' always have to cleanup + + fs/char_dev.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/proc/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/proc/kmsg.c: * Copyright (C) 1992 by Linus Torvalds + + fs/proc/generic.c: * Copyright (C) 1991, 1992 Linus Torvalds. + + fs/proc/root.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/proc/base.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/jfs/acl.c: * Copyright (C) Linus Torvalds, 1991, 1992 + + fs/proc/array.c: * Copyright (C) 1992 by Linus Torvalds + + fs/inode.c: * (C) 1997 Linus Torvalds + + fs/splice.c: * Named by Larry McVoy, original implementation from Linus, extended by + + fs/splice.c: * Copyright (C) 2005-2006 Linus Torvalds <torvalds@osdl.org> + + fs/mpage.c: * Copyright (C) 2002, Linus Torvalds. + + fs/readdir.c: * Copyright (C) 1995 Linus Torvalds + + mm/vmscan.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + fs/affs/inode.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/affs/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/minix/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/affs/dir.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/affs/super.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/minix/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/affs/namei.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/minix/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/minix/bitmap.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/minix/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/affs/file.c: * (C) 1991 Linus Torvalds - minix filesystem + + mm/fadvise.c: * Copyright (C) 2002, Linus Torvalds + + fs/attr.c: * Copyright (C) 1991, 1992 Linus Torvalds + + mm/readahead.c: * Copyright (C) 2002, Linus Torvalds + + fs/ioctl.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/befs/ChangeLog:* Anton Altaparmakov figured out (by asking Linus :) ) what was causing the + + fs/exec.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/indirect.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/indirect.c: * Linus? + + fs/ext4/fsync.c: * linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/ext4.h: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/readpage.c: * Copyright (C) 2002, Linus Torvalds. + + fs/ext4/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ext4/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ocfs2/dlmfs/dlmfs.c: * Copyright (C) 2000 Linus Torvalds. + + fs/ocfs2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/direct-io.c: * Copyright (C) 2002, Linus Torvalds. + + fs/sysv/ialloc.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/sysv/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/sysv/balloc.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/sysv/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + mm/swapfile.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + mm/truncate.c: * Copyright (C) 2002, Linus Torvalds + + fs/sysv/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/sysv/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/sysv/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + mm/vmalloc.c: * Copyright (C) 1993 Linus Torvalds + + fs/read_write.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/romfs/super.c: * Copyright © 1991, 1992 Linus Torvalds + + fs/isofs/inode.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/isofs/namei.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/isofs/dir.c: * (C) 1991 Linus Torvalds - minix filesystem + + fs/file_table.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/cramfs/uncompress.c: * (C) Copyright 1999 Linus Torvalds + + fs/cramfs/inode.c: * Copyright (C) 1999 Linus Torvalds. + + mm/msync.c: * Copyright (C) 1994-1999 Linus Torvalds + + fs/pipe.c: * Copyright (C) 1991, 1992, 1999 Linus Torvalds + + fs/fs-writeback.c: * Copyright (C) 2002, Linus Torvalds. + + mm/mlock.c: * (C) Copyright 1995 Linus Torvalds + + fs/namespace.c: * Based on code from fs/super.c, copyright Linus Torvalds and others. + + mm/mremap.c: * (C) Copyright 1996 Linus Torvalds + + fs/signalfd.c: * Copyright (C) 2003 Linus Torvalds + + mm/highmem.c: * based on Linus' idea. + + fs/select.c: * patches by Peter MacDonald. Heavily edited by Linus. + + mm/vmstat.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + fs/nilfs2/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/nilfs2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/nilfs2/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + mm/page_io.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + mm/memory.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + mm/memory.c: * things wanted, and it should be easy to implement. - Linus + + mm/memory.c: * pages started 02.12.91, seems to work. - Linus. + + mm/filemap.c: * Copyright (C) 1994-1999 Linus Torvalds + + mm/page-writeback.c: * Copyright (C) 2002, Linus Torvalds. + + net/ipv6/mcast_snoop.c: * Copyright (C) 2015: Linus Lüssing <linus.luessing@c0d3.blue> + + mm/mincore.c: * Copyright (C) 1994-2006 Linus Torvalds + + mm/shmem.c: * Copyright (C) 2000 Linus Torvalds. + + net/core/skbuff.c: * Linus Torvalds : Better skb_clone. + + net/core/skbuff.c: * Alan Cox : Added all the changed routines Linus + + mm/pgtable-generic.c: * Copyright (C) 2010 Linus Torvalds + + net/core/datagram.c: * Linus Torvalds : BSD semantic fixes. + + mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + net/dsa/tag_rtl4_a.c: * Copyright (c) 2020 Linus Walleij <linus.walleij@linaro.org> + + mm/madvise.c: * Copyright (C) 1999 Linus Torvalds + + mm/mprotect.c: * (C) Copyright 1994 Linus Torvalds + + mm/swap_state.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + mm/swap.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + mm/page_alloc.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + net/unix/af_unix.c: * Linus Torvalds : Assorted bug cures. + + mm/early_ioremap.c: * (C) Copyright 1995 1996, 2014 Linus Torvalds + + fs/stat.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/adfs/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/dcache.c: * with heavy changes by Linus Torvalds + + fs/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/binfmt_aout.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds + + net/ipv4/tcp_input.c: * Linus Torvalds, <torvalds@cs.helsinki.fi> + + net/ipv4/arp.c: * Ack spit, Linus how did you allow that + + net/ipv4/ip_input.c: * Linus Torvalds : More robustness checks + + net/ipv4/ip_input.c: * Linus Torvalds/ : Memory leakage on fragmentation + + net/ipv4/tcp_minisocks.c: * Linus Torvalds, <torvalds@cs.helsinki.fi> + + net/ipv4/tcp_output.c: * Linus Torvalds, <torvalds@cs.helsinki.fi> + + net/ipv4/tcp_output.c: * Linus Torvalds : send_delayed_ack + + net/ipv4/tcp.c: * Linus Torvalds, <torvalds@cs.helsinki.fi> + + net/ipv4/tcp.c: * Linus : Rewrote tcp_read() and URG handling + + net/ipv4/tcp.c: * Linus Torvalds : Fin/Shutdown & copied_seq changes. + + net/ipv4/tcp.c: * Linus Torvalds : Fixed BSD port reuse to work first syn + + net/ipv4/route.c: * Linus Torvalds, <Linus.Torvalds@helsinki.fi> + + net/ipv4/route.c: * Linus Torvalds : Rewrote bits to be sensible + + net/ipv4/tcp_timer.c: * Linus Torvalds, <torvalds@cs.helsinki.fi> + + fs/filesystems.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/powerpc/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/powerpc/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/powerpc/kernel/ptrace/ptrace32.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds + + arch/powerpc/kernel/ptrace/ptrace.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds + + arch/powerpc/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/powerpc/kernel/iomap.c: * (C) Copyright 2004 Linus Torvalds + + arch/powerpc/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/powerpc/kernel/process.c: * Copyright (C) 1995 Linus Torvalds + + arch/powerpc/kernel/signal_64.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ramfs/inode.c: * Copyright (C) 2000 Linus Torvalds. + + fs/ufs/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/powerpc/platforms/cell/setup.c: * Copyright (C) 1995 Linus Torvalds + + fs/ramfs/file-mmu.c: * Copyright (C) 2000 Linus Torvalds. + + fs/ufs/super.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/ufs/file.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/powerpc/platforms/pseries/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/powerpc/platforms/pseries/firmware.c: * Copyright (C) 1995 Linus Torvalds + + fs/ufs/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/powerpc/platforms/8xx/m8xx_setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/powerpc/platforms/powermac/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/powerpc/platforms/chrp/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/powerpc/platforms/chrp/setup.c: * Copyright (C) 1995 Linus Torvalds + + fs/fcntl.c: * Copyright (C) 1991, 1992 Linus Torvalds + + fs/binfmt_flat.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds + + arch/alpha/lib/divide.S: * (C) 1995 Linus Torvalds + + net/socket.c: * Linus : Argh. removed all the socket allocation + + arch/mips/kernel/signal-common.h: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/mips/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/mips/kernel/ptrace32.c: * Copyright (C) Linus Torvalds + + arch/mips/kernel/signal_o32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/mips/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/mips/kernel/signal32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/mips/kernel/ptrace.c: * Copyright (C) Linus Torvalds + + arch/mips/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/alpha/lib/csum_partial_copy.c: * (C) Copyright 1996 Linus Torvalds + + arch/alpha/lib/udelay.c: * Copyright (C) 1993, 2000 Linus Torvalds + + arch/mips/boot/compressed/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/alpha/lib/memcpy.c: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/lib/memset.S: * (C) Copyright 1996 Linus Torvalds + + arch/alpha/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/alpha/kernel/process.c: * Copyright (C) 1995 Linus Torvalds + + arch/mips/jazz/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/alpha/kernel/sys_jensen.c: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/kernel/rtc.c: * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds + + arch/alpha/kernel/irq.c: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/kernel/time.c: * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds + + arch/alpha/kernel/osf_sys.c: * Copyright (C) 1995 Linus Torvalds + + arch/mips/lib/iomap-pci.c: * (C) Copyright 2004 Linus Torvalds + + arch/alpha/kernel/irq_impl.h: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/kernel/ptrace.c:/* edited by Linus Torvalds */ + + arch/alpha/kernel/signal.c: * Copyright (C) 1995 Linus Torvalds + + arch/alpha/kernel/traps.c: * (C) Copyright 1994 Linus Torvalds + + arch/alpha/lib/fpreg.c: * (C) Copyright 1998 Linus Torvalds + + arch/alpha/boot/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/alpha/boot/bootpz.c: * based significantly on the arch/alpha/boot/main.c of Linus Torvalds + + arch/alpha/boot/main.c: * Copyright (C) 1994, 1995 Linus Torvalds + + arch/mips/dec/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/alpha/boot/bootp.c: * based significantly on the arch/alpha/boot/main.c of Linus Torvalds + + arch/mips/include/asm/mach-generic/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors + + arch/mips/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/mips/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + arch/mips/sni/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/alpha/include/asm/bitops.h: * Copyright 1994, Linus Torvalds. + + arch/alpha/include/asm/mmu_context.h: * Copyright (C) 1996, Linus Torvalds + + arch/alpha/include/asm/irq.h: * (C) 1994 Linus Torvalds + + arch/alpha/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds + + arch/alpha/include/asm/processor.h: * Copyright (C) 1994 Linus Torvalds + + arch/alpha/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/arm/kernel/tcm.c: * Author: Linus Walleij <linus.walleij@stericsson.com> + + arch/arm/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/arm/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/arm/kernel/ptrace.c: * edited by Linus Torvalds + + arch/arm/kernel/process.c: * Original Copyright (C) 1995 Linus Torvalds + + arch/arm/kernel/reboot.c: * Original Copyright (C) 1995 Linus Torvalds + + arch/arm/kernel/traps.c: * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds + + arch/arm/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts: * Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org> + + arch/arm/lib/getuser.S: * Idea from x86 version, (C) Copyright 1998 Linus Torvalds + + arch/arm/lib/putuser.S: * Idea from x86 version, (C) Copyright 1998 Linus Torvalds + + arch/arm/mach-realview/realview-dt.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + arch/arm/mach-realview/platsmp-dt.c: * Copyright (C) 2015 Linus Walleij + + arch/arm/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/arm/mm/fault-armv.c: * Copyright (C) 1995 Linus Torvalds + + arch/arm/mm/kasan_init.c: * Author: Linus Walleij <linus.walleij@linaro.org> + + arch/arm/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + arch/arm/mm/tcm.h: * Author: Linus Walleij <linus.walleij@stericsson.com> + + arch/arm/mm/alignment.c: * Copyright (C) 1995 Linus Torvalds + + arch/arm/include/asm/tcm.h: * Author: Linus Walleij <linus.walleij@stericsson.com> + + arch/arm/include/asm/bitops.h: * Linus Torvalds (test_bit). + + arch/arm/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors + + arch/alpha/mm/init.c: * Copyright (C) 1995 Linus Torvalds + + arch/ia64/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/ia64/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/ia64/include/asm/elf.h: * place to do this, but we should discuss this with Linus once we can + + arch/powerpc/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors + + arch/powerpc/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/powerpc/mm/pgtable_64.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/init_64.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/book3s32/mmu_context.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/book3s32/tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/fault.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/um/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/powerpc/mm/book3s32/mmu.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/mmu_decl.h: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/mem.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/init_32.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/init-common.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/book3s64/hash_tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/pgtable_32.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/pgtable.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/nohash/fsl_book3e.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/nohash/40x.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/nohash/44x.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/powerpc/mm/nohash/tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/sh/kernel/process_32.c: * Copyright (C) 1995 Linus Torvalds + + arch/sh/kernel/dumpstack.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/sh/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/sh/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/xtensa/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds + + arch/xtensa/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar + + arch/xtensa/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/sh/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/sh/mm/init.c: * Copyright (C) 1995 Linus Torvalds + + arch/sh/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + arch/sh/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/microblaze/kernel/ptrace.c: * Copyright (C) Linus Torvalds + + arch/microblaze/kernel/signal.c: * Copyright (C) 1991,1992 Linus Torvalds + + arch/microblaze/mm/fault.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/microblaze/mm/mmu_context.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/h8300/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. + + arch/h8300/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/microblaze/mm/pgtable.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds + + arch/microblaze/pci/iomap.c: * (C) Copyright 2004 Linus Torvalds + + arch/h8300/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/nios2/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/nios2/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/arm64/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/arm64/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + arch/sparc/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/sparc/kernel/ptrace_64.c: * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson, + + arch/sparc/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/sparc/kernel/wof.S: * to see what happens. I can hear Linus now + + arch/sparc/kernel/ptrace_32.c: * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson, + + arch/sparc/kernel/signal32.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/sparc/kernel/signal_64.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/sparc/lib/memcpy.S: * Copyright (C) 1995 Linus Torvalds (Linus.Torvalds@helsinki.fi) + + arch/sparc/lib/checksum_32.S: * Copyright(C) 1995 Linus Torvalds + + arch/sparc/lib/copy_user.S: * Copyright(C) 1995 Linus Torvalds + + arch/sparc/lib/checksum_64.S: * Copyright(C) 1995 Linus Torvalds + + arch/sparc/include/asm/uaccess_64.h: * "For historical reasons, these macros are grossly misnamed." -Linus + + arch/sparc/include/asm/checksum_64.h: * Copyright(C) 1995 Linus Torvalds + + arch/sparc/include/asm/thread_info_32.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller + + arch/sparc/include/asm/mmu_context_64.h:/* Derived heavily from Linus's Alpha/AXP ASN code... */ + + arch/sparc/include/asm/checksum_32.h: * Copyright(C) 1995 Linus Torvalds + + arch/sparc/include/asm/uaccess_32.h: * "For historical reasons, these macros are grossly misnamed." -Linus + + arch/openrisc/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/arm64/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/arm64/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/arm64/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/arm64/kernel/ptrace.c: * edited by Linus Torvalds + + arch/arm64/kernel/process.c: * Original Copyright (C) 1995 Linus Torvalds + + arch/parisc/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/s390/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/s390/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/s390/kernel/setup.c: * Copyright (C) 1995, Linus Torvalds + + arch/s390/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/s390/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/s390/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/s390/kernel/compat_signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/s390/include/asm/pgalloc.h: * Copyright (C) 1994 Linus Torvalds + + arch/s390/include/asm/timex.h: * Copyright (C) 1992, Linus Torvalds + + arch/s390/include/asm/delay.h: * Copyright (C) 1993 Linus Torvalds + + arch/s390/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds + + arch/s390/include/asm/cache.h: * Copyright (C) 1992, Linus Torvalds + + arch/s390/include/asm/processor.h: * Copyright (C) 1994, Linus Torvalds + + arch/s390/mm/init.c: * Copyright (C) 1995 Linus Torvalds + + arch/s390/mm/fault.c: * Copyright (C) 1995 Linus Torvalds + + arch/riscv/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/parisc/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/parisc/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds + + arch/parisc/kernel/setup.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/parisc/kernel/processor.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/parisc/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/parisc/Makefile:# Copyright (C) 1994 by Linus Torvalds + + arch/parisc/mm/init.c: * Copyright (C) 1995 Linus Torvalds + + arch/parisc/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors + + arch/parisc/include/asm/processor.h: * Copyright (C) 1994 Linus Torvalds + + arch/parisc/lib/delay.c: * Copyright (C) 1993 Linus Torvalds + + arch/parisc/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds + + .mailmap:Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> + + .mailmap:Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@web.de> + + arch/m68k/install.sh:# Copyright (C) 1995 by Linus Torvalds + + arch/m68k/68000/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/m68k/kernel/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/m68k/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds + + arch/m68k/kernel/ptrace.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds + + arch/m68k/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/m68k/kernel/syscalltable.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/m68k/coldfire/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds + + arch/m68k/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. + + arch/m68k/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors + + arch/m68k/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds + + + + + + diff --git a/crates/anstyle-svg/tests/rg_linus.vte b/crates/anstyle-svg/tests/rg_linus.vte new file mode 100644 index 00000000..e4fb2bd9 --- /dev/null +++ b/crates/anstyle-svg/tests/rg_linus.vte @@ -0,0 +1,1159 @@ +kernel/sys.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/fork.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/exit.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/time/timer.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/time/time.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/user.c: * (C) Copyright 1991-2000 Linus Torvalds +kernel/ptrace.c: * (C) Copyright 1999 Linus Torvalds +kernel/irq/irqdesc.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/irq/spurious.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar +kernel/irq/autoprobe.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar +kernel/irq/chip.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/irq/proc.c: * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar +kernel/irq/dummychip.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/irq/handle.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/irq/resend.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/irq/manage.c: * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar +kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/futex/core.c: * enough at me, Linus for the original (flawed) idea, Matthew +kernel/resource.c: * Copyright (C) 1999 Linus Torvalds +kernel/softirq.c: * Copyright (C) 1992 Linus Torvalds +kernel/printk/printk.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/sched/core.c: * Copyright (C) 1991-2002 Linus Torvalds +kernel/panic.c: * Copyright (C) 1991, 1992 Linus Torvalds +kernel/locking/spinlock.c: * Copyright (2004) Linus Torvalds +kernel/reboot.c: * Copyright (C) 2013 Linus Torvalds +LICENSES/exceptions/Linux-syscall-note: Linus Torvalds +tools/build/Build.include:# Copyright (C) Linus Torvalds , 2015 +tools/build/Makefile.build:# Copyright (C) Linus Torvalds , 2015 +tools/perf/CREDITS: Linus Torvalds +tools/perf/util/config.c: * Copyright (C) Linus Torvalds, 2005 +tools/testing/selftests/vm/charge_reserved_hugetlb.sh: # On linus/master, the above process gets SIGBUS'd on oomkill, with +tools/perf/util/usage.c: * Copyright (C) Linus Torvalds, 2005 +tools/testing/selftests/powerpc/stringloops/string.c: * Copyright (C) 1991, 1992 Linus Torvalds +tools/lib/string.c: * Copyright (C) 1991, 1992 Linus Torvalds +tools/lib/ctype.c: * Copyright (C) 1991, 1992 Linus Torvalds +tools/scripts/Makefile.include:# that takes into account Linus's comments (search for Wshadow) for the reasoning about +tools/gpio/gpio-utils.h: * Copyright (C) 2015 Linus Walleij +tools/gpio/gpio-utils.c: * Copyright (C) 2015 Linus Walleij +tools/gpio/gpio-event-mon.c: * Copyright (C) 2016 Linus Walleij +tools/gpio/gpio-hammer.c: * Copyright (C) 2016 Linus Walleij +tools/gpio/lsgpio.c: * Copyright (C) 2015 Linus Walleij +tools/power/cpupower/utils/idle_monitor/mperf_monitor.c: * Compare with Linus kernel git commit: acf01734b1747b1ec4 +tools/power/cpupower/utils/cpupower.c: * Ideas taken over from the perf userspace tool (included in the Linus +init/calibrate.c: * Copyright (C) 1991, 1992 Linus Torvalds +security/Kconfig.hardening: https://git.kernel.org/linus/b9e146d8eb3b9eca +security/Kconfig.hardening: https://git.kernel.org/linus/06e7e776ca4d3654 +block/partitions/efi.c: * - Ported to 2.5.2-pre11 + library crc32 patch Linus applied +block/bdev.c: * Copyright (C) 1991, 1992 Linus Torvalds +block/fops.c: * Copyright (C) 1991, 1992 Linus Torvalds +block/blk-core.c: * Copyright (C) 1991, 1992 Linus Torvalds +block/partitions/osf.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/amiga.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/sun.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/msdos.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/mac.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/atari.c: * Copyright (C) 1991-1998 Linus Torvalds +block/partitions/core.c: * Copyright (C) 1991-1998 Linus Torvalds +init/main.c: * Copyright (C) 1991, 1992 Linus Torvalds +MAINTAINERS: job the maintainers (and especially Linus) do is to keep things +MAINTAINERS: your changes in a branch derived from Linus' latest git tree. +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linusw@kernel.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Walleij <linus.walleij@linaro.org> +MAINTAINERS:M: Linus Torvalds +CREDITS: Linus +CREDITS:N: Linus Torvalds +scripts/Makefile.build:# Linus' kernel sanity checking tool +Documentation/networking/netdev-FAQ.rst:mainline tree from Linus, and ``net-next`` is where the new code goes +Documentation/networking/netdev-FAQ.rst:How often do changes from these trees make it to the mainline Linus tree? +Documentation/networking/netdev-FAQ.rst:to Linus for merging into the mainline tree. After the two weeks, the +Documentation/networking/netdev-FAQ.rst:mainline/Linus via a pull request for vX.Y -- at the same time, the +Documentation/networking/netdev-FAQ.rst:fed back to Linus at regular (~weekly) intervals. Meaning that the +Documentation/networking/netdev-FAQ.rst:Load the mainline (Linus) page here: +lib/vsprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds +lib/vsprintf.c:/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ +drivers/dma/s3c24xx-dma.c: * Author: Linus Walleij <linus.walleij@stericsson.com> +lib/string.c: * Copyright (C) 1991, 1992 Linus Torvalds +lib/kasprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds +lib/iomap.c: * (C) Copyright 2004 Linus Torvalds +drivers/dma/amba-pl08x.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/thermal/db8500_thermal.c: * Authors: Hongbo Zhang, Linus Walleij +drivers/auxdisplay/arm-charlcd.c: * Author: Linus Walleij +drivers/gpu/drm/tve200/tve200_drm.h: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/tve200/tve200_display.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/tve200/tve200_drv.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/tve200/tve200_drv.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/mcde/mcde_display.c: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/mcde/mcde_drm.h: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/mcde/mcde_drv.c: * Copyright (C) 2018 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/mcde/mcde_drv.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-sony-acx424akp.c: * Author: Linus Walleij +drivers/gpu/drm/panel/panel-sony-acx424akp.c:MODULE_AUTHOR("Linus Wallei <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-ilitek-ili9341.c: * the reuse of DBI abstraction part referred from Linus's patch +drivers/gpu/drm/panel/panel-ilitek-ili9322.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/panel/panel-ilitek-ili9322.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-arm-versatile.c: * Linus Walleij <linus.wallei@linaro.org> +drivers/gpu/drm/panel/panel-arm-versatile.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-novatek-nt35510.c: * Copyright (C) 2020 Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/panel/panel-novatek-nt35510.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-samsung-db7430.c: * Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/panel/panel-samsung-db7430.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-samsung-s6d16d0.c:MODULE_AUTHOR("Linus Wallei <linus.walleij@linaro.org>"); +drivers/bus/arm-integrator-lm.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/bus/arm-integrator-lm.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-widechips-ws2401.c: * Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/panel/panel-widechips-ws2401.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c: * (C) 2019 Linus Walleij +drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c:MODULE_AUTHOR("Linus Walleij <linusw@kernel.org>"); +drivers/bus/qcom-ebi2.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/bus/qcom-ebi2.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpu/drm/panel/panel-tpo-tpg110.c: * Linus Walleij <linus.walleij@linaro.org> +drivers/gpu/drm/panel/panel-tpo-tpg110.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/spi/spi-pl022.c: * Author: Linus Walleij <linus.walleij@stericsson.com> +drivers/spi/spi-pl022.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@stericsson.com>"); +drivers/spi/spi-gpio.c: * Copyright (C) 2017 Linus Walleij +drivers/bus/intel-ixp4xx-eb.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/bus/intel-ixp4xx-eb.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/char/mem.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/char/lp.c: * Copyright (C) 1992 by Jim Weigand and Linus Torvalds +drivers/char/misc.c: * Based on code from Linus +drivers/char/misc.c: * of the misc drivers, as they are now completely independent. Linus. +drivers/char/agp/efficeon-agp.c: * Based upon a diff by Linus around November '02. +drivers/mfd/ipaq-micro.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/mfd/stw481x.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/mfd/stw481x.c:MODULE_AUTHOR("Linus Walleij"); +drivers/irqchip/irq-xtensa-pic.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +drivers/pinctrl/pinconf.h: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/irqchip/irq-i8259.c: * Copyright (C) 1992 Linus Torvalds +drivers/pinctrl/pinmux.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/pinctrl-gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/core.h: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/pinconf.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/nomadik/pinctrl-nomadik.c: * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/pinconf-generic.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/pinctrl/pinmux.h: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/irqchip/irq-ftintc010.c: * irqchip for the Faraday Technology FTINTC010 Copyright (C) 2017 Linus +drivers/irqchip/irq-ftintc010.c: * Walleij <linus.walleij@linaro.org> +drivers/irqchip/irq-gic-realview.c: * Copyright (C) 2015 Linus Walleij +drivers/mfd/tps6105x.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/mfd/tps6105x.c:MODULE_AUTHOR("Linus Walleij"); +drivers/pinctrl/core.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/irqchip/irq-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> +Documentation/networking/device_drivers/hamradio/z8530drv.rst:Many thanks to Linus Torvalds and Alan Cox for including the driver +drivers/pcmcia/cardbus.c: * Linus, Jan 2000 +drivers/mtd/maps/physmap-gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/mtd/maps/physmap-versatile.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/pcmcia/yenta_socket.c: * (C) Copyright 1999, 2000 Linus Torvalds +drivers/mtd/parsers/afs.c: Copyright (C) 2019 Linus Walleij +drivers/mtd/maps/physmap-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> +lib/ctype.c: * Copyright (C) 1991, 1992 Linus Torvalds +lib/pci_iomap.c: * (C) Copyright 2004 Linus Torvalds +drivers/block/floppy.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/block/floppy.c: * by entropy@wintermute.wpi.edu (Lawrence Foard). Linus. +drivers/block/floppy.c: * 1993/4/29 -- Linus -- cleaned up the timer handling in the kernel, and +drivers/usb/core/hub.h: * Copyright (C) 1999 Linus Torvalds +drivers/usb/core/generic.c: * (C) Copyright Linus Torvalds 1999 +drivers/usb/core/hcd.c: * (C) Copyright Linus Torvalds 1999 +drivers/usb/misc/sisusbvga/sisusb_con.c: * based on code Copyright (C) 1991, 1992 Linus Torvalds +drivers/usb/core/usb.c: * (C) Copyright Linus Torvalds 1999 +drivers/usb/core/driver.c: * (C) Copyright Linus Torvalds 1999 +drivers/usb/core/hub.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/core/file.c: * (C) Copyright Linus Torvalds 1999 +Documentation/arm/tcm.rst:Written by Linus Walleij <linus.walleij@stericsson.com> +drivers/usb/mon/mon_bin.c:/* #2 used to be MON_IOCX_URB, removed before it got into Linus tree */ +Documentation/locking/spinlocks.rst: Linus +Documentation/spi/spi-summary.rst:- Linus Walleij +drivers/usb/host/bcma-hcd.c: * Copyright 1999 Linus Torvalds +drivers/usb/host/ehci-platform.c: * Copyright 1999 Linus Torvalds +drivers/usb/host/uhci-grlib.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/host/ohci-hcd.c: * [ Initialisation is based on Linus' ] +drivers/usb/host/ohci-hcd.c: * [ (C) Copyright 1999 Linus Torvalds ] +drivers/usb/host/ssb-hcd.c: * Copyright 1999 Linus Torvalds +drivers/usb/host/uhci-hub.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/host/uhci-pci.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/host/ohci.h: * a subset of what the full implementation needs. (Linus) +drivers/usb/host/uhci-debug.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/host/ohci-pci.c: * [ Initialisation is based on Linus' ] +drivers/usb/host/ohci-pci.c: * [ (C) Copyright 1999 Linus Torvalds ] +drivers/usb/host/ohci-platform.c: * Copyright 1999 Linus Torvalds +drivers/usb/host/uhci-hcd.c: * (C) Copyright 1999 Linus Torvalds +drivers/usb/host/uhci-hcd.c: "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, " \ +drivers/usb/host/uhci-q.c: * (C) Copyright 1999 Linus Torvalds +scripts/patch-kernel:# directory above to the latest Linus kernel +scripts/patch-kernel:# Note: It uses the patches relative to the Linus kernels, not the +scripts/get_maintainer.pl:push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org"); +scripts/get_maintainer.pl: warn("Try Linus Torvalds' latest git repository using:\n"); +Documentation/RCU/rcu_dereference.rst: rcu_dereference() against non-NULL values. As Linus Torvalds +Documentation/RCU/RTFP.txt:[LinusTorvalds2011Linux2:6:38:rc1:NPigginVFS], an RCU-protected red-black +Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2001a +Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" +Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2003a +Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" +Documentation/RCU/RTFP.txt: Linus suggests replacing brlock with RCU and/or seqlocks: +Documentation/RCU/RTFP.txt:@unpublished{LinusTorvalds2011Linux2:6:38:rc1:NPigginVFS +Documentation/RCU/RTFP.txt:,Author="Linus Torvalds" +Documentation/cdrom/cdrom-standard.rst:of course, I want to thank Linus Torvalds for making this possible in +Documentation/RCU/Design/Requirements/Requirements.rst:This all should be quite obvious, but the fact remains that Linus +Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst:Linux is a registered trademark of Linus Torvalds. +Documentation/RCU/Design/Data-Structures/Data-Structures.rst:Linux is a registered trademark of Linus Torvalds. +Documentation/security/lsm.rst:In response to the NSA presentation, Linus Torvalds made a set of +Documentation/security/lsm.rst:desired model of security. Linus also suggested the possibility of +scripts/package/mkdebian:Copyright: 1991 - 2018 Linus Torvalds and others. +drivers/hwmon/drivetemp.c: * (C) 2018 Linus Walleij +drivers/hwmon/drivetemp.c:MODULE_AUTHOR("Guenter Roeck <linus@roeck-us.net>"); +scripts/checkstack.pl:# Inspired by Linus Torvalds +Documentation/vm/active_mm.rst: From: Linus Torvalds +Documentation/block/biodoc.rst:Larry McVoy (and subsequent discussions on lkml, and Linus' comments - Jan 2001 +Documentation/block/biodoc.rst:On lkml between sct, linus, alan et al - Feb-March 2001 (many of the +Documentation/usb/CREDITS: Linus Torvalds +Documentation/usb/CREDITS: - Linus Torvalds, for starting, developing and managing Linux. +Documentation/ABI/obsolete/sysfs-gpio:Contact: Linus Walleij <linusw@kernel.org> +Documentation/userspace-api/ioctl/ioctl-number.rst:patch to Linus Torvalds. Or you can e-mail me at and +Documentation/sound/hd-audio/notes.rst:and next kernels are found in for-linus and for-next branches, +Documentation/process/maintainer-pgp-guide.rst:auto-retrieve the keys for Linus Torvalds and Greg Kroah-Hartman (if you +Documentation/process/maintainer-pgp-guide.rst:``C94035C21B4F2AEB``. Now display the key of Linus Torvalds that you +Documentation/process/maintainer-pgp-guide.rst: uid [ unknown] Linus Torvalds +Documentation/process/maintainer-pgp-guide.rst:Next, find a trust path from Linus Torvalds to the key-id you found via ``gpg +Documentation/process/deprecated.rst:`_ +Documentation/process/deprecated.rst:to debug or even get viable crash reports. Linus has `very strong +Documentation/process/deprecated.rst:`_.) +Documentation/process/deprecated.rst:Paraphrasing Linus's current `guidance `_: +Documentation/process/deprecated.rst: up to Linus's scrutiny, maybe you can use "%px", along with making sure +Documentation/process/deprecated.rst:`_". +Documentation/process/deprecated.rst:`_ are reason enough to +Documentation/process/deprecated.rst:`_ +Documentation/process/deprecated.rst:`_, +Documentation/process/deprecated.rst:`_. +Documentation/process/2.Process.rst:time, Linus Torvalds will declare that the window is closed and release the +Documentation/process/2.Process.rst:time. Linus releases new -rc kernels about once a week; a normal series +Documentation/process/2.Process.rst: merged into the mainline repository managed by Linus Torvalds. More +Documentation/process/2.Process.rst:repository: Linus Torvalds. But, for example, of the over 9,500 patches +Documentation/process/2.Process.rst:chosen by Linus himself. The kernel project has long since grown to a size +Documentation/process/2.Process.rst:When the merge window opens, top-level maintainers will ask Linus to "pull" +Documentation/process/2.Process.rst:Linus agrees, the stream of patches will flow up into his repository, +Documentation/process/2.Process.rst:becoming part of the mainline kernel. The amount of attention that Linus +Documentation/process/2.Process.rst:that, sometimes, he looks quite closely. But, as a general rule, Linus +Documentation/process/2.Process.rst:finding the right maintainer. Sending patches directly to Linus is not +Documentation/process/2.Process.rst:an appropriate subsystem tree or be sent directly to Linus. In a typical +Documentation/process/4.Coding.rst:breaks? The best answer to this question was expressed by Linus in July, +Documentation/process/kernel-enforcement-statement.rst: - Linus Torvalds +Documentation/process/kernel-enforcement-statement.rst: - Linus Walleij +Documentation/process/7.AdvancedTopics.rst:when Linus first started playing with the proprietary BitKeeper +Documentation/process/7.AdvancedTopics.rst:can affect your ability to get trees pulled in the future. Quoting Linus: +Documentation/process/adding-syscalls.rst: - Collated emails from Linus Torvalds discussing the problems with ``ioctl()``: +Documentation/process/adding-syscalls.rst: - Recommendation from Linus Torvalds that x32 system calls should prefer +Documentation/process/embargoed-hardware-issues.rst: - Linus Torvalds (Linux Foundation Fellow) +Documentation/process/howto.rst: - Linus's mainline tree +Documentation/process/howto.rst:The mainline tree is maintained by Linus Torvalds, and can be found at +Documentation/process/howto.rst: Linus, usually the patches that have already been included in the +Documentation/process/howto.rst: patches to Linus after -rc1 is released, but the patches need to also be +Documentation/process/howto.rst: - A new -rc is released whenever Linus deems the current git tree to +Documentation/process/stable-kernel-rules.rst: - It or an equivalent fix must already exist in Linus' tree (upstream). +Documentation/process/stable-kernel-rules.rst:After the patch has been merged to Linus' tree, send an email to +Documentation/process/1.Intro.rst:mainline kernel (the "mainline" being the kernel maintained by Linus +Documentation/process/applying-patches.rst:These are the base stable releases released by Linus. The highest numbered +Documentation/process/applying-patches.rst:by Linus whenever he deems the current git (the kernel's source management +Documentation/process/applying-patches.rst:and, during the merge window, sends them directly to Linus. +Documentation/process/applying-patches.rst:it on to Linus for inclusion in mainline. +Documentation/process/applying-patches.rst:the more stable mainline Linus tree. +Documentation/process/applying-patches.rst:Thank you's to Randy Dunlap, Rolf Eike Beer, Linus Torvalds, Bodo Eggert, +Documentation/process/5.Posting.rst:Linus's git tree. When basing on mainline, start with a well-known release +Documentation/process/5.Posting.rst:is possible to send patches directly to Linus Torvalds and have him merge +Documentation/process/5.Posting.rst:them, things are not normally done that way. Linus is busy, and there are +Documentation/process/6.Followthrough.rst:kernel, nobody has absolute veto power over any code. Except maybe Linus. +Documentation/process/submitting-patches.rst:Linus Torvalds is the final arbiter of all changes accepted into the +Documentation/process/submitting-patches.rst:Linus directly, so typically you should do your best to -avoid- +Documentation/process/submitting-patches.rst:Linus and other kernel developers need to be able to read and comment +Documentation/process/submitting-patches.rst:code. A MIME attachment also takes Linus a bit more time to process, +Documentation/process/submitting-patches.rst:Due to high e-mail traffic to Linus, and to linux-kernel, it is common +Documentation/process/submitting-patches.rst:convention to prefix your subject line with [PATCH]. This lets Linus +Documentation/process/submitting-patches.rst:as it was propagated to the maintainers and ultimately to Linus, with +Documentation/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: +Documentation/process/volatile-considered-harmful.rst: to be a "stupid legacy" issue (Linus's words) in this regard; fixing it +Documentation/core-api/bus-virt-phys-mapping.rst::Author: Linus +Documentation/driver-api/usb/dwc3.rst: 1. You're running latest tag from `Linus' tree`_ +Documentation/driver-api/usb/dwc3.rst:.. _Linus' tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ +drivers/ata/sata_gemini.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/ata/sata_gemini.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/ata/pata_opti.c: * Copyright (C) 1996-1998 Linus Torvalds & authors (see below) +drivers/ata/pata_ftide010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/ata/pata_ftide010.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/ata/pata_cmd640.c: * Copyright (C) 1995-1996 Linus Torvalds & authors (see driver) +drivers/ata/pata_rz1000.c: * Copyright (C) 1995-1998 Linus Torvalds & author (see below) +drivers/base/pinctrl.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/base/power/trace.c: * Copyright (C) 2006 Linus Torvalds +Documentation/scsi/scsi_mid_low_api.rst:First, Linus Torvalds's thoughts on C coding style can be found in the +drivers/scsi/qla1280.c: Rev 3.23.19 Beta April 11, 2002, Linus Torvalds +drivers/video/fbdev/via/via-core.c: * -- Linus Torvalds, Dec. 7, 2009 +drivers/video/console/vgacon.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/video/console/sticon.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/video/backlight/ipaq_micro_bl.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/video/console/mdacon.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/video/backlight/ktd253-backlight.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/rtc/rtc-ab8500.c: * Linus Walleij <linus.walleij@stericsson.com> +drivers/gpio/gpio-gw-pld.c:// Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> +drivers/gpio/gpio-gw-pld.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/gpio/gpio-max732x.c: * Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org> +drivers/gpio/gpio-ftgpio010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/gpio/gpio-ixp4xx.c:// Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> +drivers/watchdog/ftwdt010_wdt.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/watchdog/ftwdt010_wdt.c:MODULE_AUTHOR("Linus Walleij"); +drivers/watchdog/ixp4xx_wdt.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/mmc/core/host.c: * Copyright (C) 2010 Linus Walleij +drivers/iio/light/cm3605.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/light/cm3605.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/iio/light/bh1780.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/light/bh1780.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/iio/light/gp2ap002.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/light/gp2ap002.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/iio/gyro/mpu3050-i2c.c:MODULE_AUTHOR("Linus Walleij"); +drivers/iio/gyro/mpu3050-core.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/gyro/mpu3050-core.c:MODULE_AUTHOR("Linus Walleij"); +drivers/iio/pressure/bmp280-core.c: * Copyright (c) 2016 Linus Walleij <linus.walleij@linaro.org> +drivers/iio/adc/qcom-pm8xxx-xoadc.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/adc/ab8500-gpadc.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/magnetometer/ak8974.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/magnetometer/ak8974.c:MODULE_AUTHOR("Linus Walleij"); +drivers/iio/magnetometer/yamaha-yas530.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/iio/magnetometer/yamaha-yas530.c:MODULE_AUTHOR("Linus Walleij"); +drivers/pwm/pwm-stmpe.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/firmware/efi/libstub/string.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/firmware/efi/libstub/vsprintf.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/power/supply/ipaq_micro_battery.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/power/reset/arm-versatile-reboot.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/power/reset/gemini-poweroff.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/leds/leds-syscon.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/leds/flash/leds-rt8515.c: * Linus Walleij <linus.walleij@linaro.org> +drivers/leds/flash/leds-rt8515.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/leds/leds-ipaq-micro.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/leds/trigger/ledtrig-cpu.c: * Copyright 2011 Linus Walleij <linus.walleij@linaro.org> +drivers/regulator/stw481x-vmmc.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/regulator/tps6105x-regulator.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/regulator/tps6105x-regulator.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/of/irq.c: * Copyright (C) 1992 Linus Torvalds +Documentation/kernel-hacking/locking.rst:- ``Documentation/locking/spinlocks.rst``: Linus Torvalds' spinlocking +Documentation/kernel-hacking/hacking.rst:Linus. +Documentation/kernel-hacking/hacking.rst:Linus and the other developers sometimes change function or structure +Documentation/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky +Documentation/maintainer/pull-requests.rst:and Linus Torvalds on LKML. Suggestions and fixes by Jonathan Corbet and +Documentation/maintainer/pull-requests.rst:Linus will only accept pull requests based on a signed tag. Other +Documentation/maintainer/pull-requests.rst:As said by Linus:: +Documentation/maintainer/pull-requests.rst: Linus +Documentation/maintainer/pull-requests.rst: branch (which in my case points to the last location in Linus's +Documentation/maintainer/pull-requests.rst:Linus responded that he tends to prefer the ``git://`` protocol. Other +Documentation/maintainer/pull-requests.rst:lists if required. Pull requests to Linus typically have a subject line +Documentation/maintainer/rebasing-and-merging.rst:A frequent cause of merge-window trouble is when Linus is presented with a +Documentation/maintainer/rebasing-and-merging.rst:for the final pull request: Linus is adamant that he would much rather see +Documentation/maintainer/rebasing-and-merging.rst:Linus in the pull request that the conflict will happen; if nothing else, +drivers/tty/n_tty.c: * This file also contains code originally written by Linus Torvalds, +drivers/pci/controller/pci-v3-semi.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/pci/controller/pci-ftpci100.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/pci/controller/pci-ixp4xx.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/tty/tty_jobctrl.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/tty/tty_ioctl.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +drivers/tty/tty_baudrate.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +drivers/tty/amiserial.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/tty/pty.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/tty/mxser.c: * Linux serial driver, written by Linus Torvalds, Theodore T'so and +drivers/tty/serial/8250/8250.h: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/8250/8250_port.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/8250/8250_core.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/8250/8250_pnp.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/mux.c: * rmk has already submitted a patch to linus, should be available for +drivers/tty/serial/8250/8250_pci.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/atmel_serial.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/sa1100.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/imx.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/amba-pl011.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/ar933x_uart.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/amba-pl010.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/clps711x.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/lantiq.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/serial/serial_core.c: * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. +drivers/tty/moxa.c: * Linus Torvalds, Theodore T'so and others. +drivers/tty/tty_io.c: * Copyright (C) 1991, 1992 Linus Torvalds +drivers/tty/vt/keyboard.c: * the assembly version by Linus (with diacriticals added) +drivers/tty/vt/vt.c: * Copyright (C) 1991, 1992 Linus Torvalds +Documentation/x86/exception-tables.rst:To overcome this situation, Linus decided to let the virtual memory +Documentation/bpf/bpf_devel_QA.rst:into the kernel mainline tree run by Linus Torvalds. To read up on the +Documentation/bpf/bpf_devel_QA.rst:your patch series once bpf-next is open again. Once Linus released +drivers/input/mouse/amimouse.c: * Nathan Laredo Linus Torvalds +drivers/input/mouse/gpio_mouse.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/input/mouse/logibm.c: * Linus Torvalds Johan Myreen +drivers/input/keyboard/ipaq-micro-keys.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/input/keyboard/dlink-dir685-touchkeys.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/input/keyboard/dlink-dir685-touchkeys.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +Documentation/admin-guide/README.rst: Linus Torvalds with assistance from a loosely-knit team of hackers across +Documentation/admin-guide/bug-hunting.rst:In order to help Linus and the other kernel developers there has been +Documentation/admin-guide/reporting-issues.rst:Linus Torvalds and the leading Linux kernel developers want to see some issues +Documentation/admin-guide/reporting-issues.rst:Linux lead developer Linus Torvalds insists that the Linux kernel never +Documentation/admin-guide/reporting-issues.rst:it's okay to get Linus Torvalds involved. +Documentation/admin-guide/reporting-issues.rst:to get resolved. The maintainers or if all else fails Linus Torvalds himself +drivers/input/touchscreen/ipaq-micro-ts.c: * Author : Linus Walleij <linus.walleij@linaro.org> +drivers/input/touchscreen/cy8ctma140.c: * (C) 2020 Linus Walleij <linus.walleij@linaro.org> +drivers/input/touchscreen/cy8ctma140.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +Documentation/power/s2ram.rst:2006 Linus Torvalds +Documentation/power/s2ram.rst:3) You can use Linus' TRACE_RESUME infrastructure, described below. +Documentation/power/freezing-of-tasks.rst:Although Linus Torvalds doesn't like the freezing of tasks, he said this in one +Documentation/power/freezing-of-tasks.rst:Linus: In many ways, 'at all'. +Documentation/dev-tools/sparse.rst:.. Copyright 2004 Linus Torvalds +Documentation/crypto/api-intro.rst: - Linus Torvalds (i586) +Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/mtd/partitions/redboot-fis.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/arm,versatile.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/bus/arm,integrator-ap-lm.yaml: - Linus Walleij <linusw@kernel.org> +Documentation/devicetree/bindings/bus/intel,ixp4xx-expansion-bus-controller.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/arm,integrator.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/spi/spi-pl022.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/arm,scu.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/gemini.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/arm,realview.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/arm/ux500.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/pinctrl/pinmux-node.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/ata/pata-common.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/ata/intel,ixp4xx-compact-flash.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/ata/sata-common.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/ata/faraday,ftide010.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/pinctrl/pinctrl.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/rtc/faraday,ftrtc010.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/mmc/arm,pl18x.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/st,st-sensors.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/gpio/pl061-gpio.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/extcon/fcs,fsa880.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/clock/stericsson,u8500-clks.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/filesystems/path-lookup.rst:The second reason was `outlined recently`_ by Linus: +Documentation/filesystems/dlmfs.rst:Some code taken from ramfs which is Copyright |copy| 2000 Linus Torvalds +Documentation/devicetree/bindings/clock/arm,syscon-icst.yaml: - Linus Walleij <linusw@kernel.org> +Documentation/devicetree/bindings/pci/faraday,ftpci100.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/leds/richtek,rt8515.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/leds/register-bit-led.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/auxdisplay/arm,versatile-lcd.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/leds/backlight/kinetic,ktd253.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/power/supply/samsung,battery.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/process/1.Intro.rst:s'intende quello mantenuto da Linus Torvalds e usato come base dai +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:potrete auto-recuperare le chiavi di Linus Torvalds e Greg Kroah-Hartman +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:``C94035C21B4F2AEB``. Ora visualizzate le chiavi di Linus Torvalds +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst: uid [ unknown] Linus Torvalds +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:digitale della chiave di Linus Torvalds che si vede nell'output qui sopra. +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:- `Finding paths to Linus`_ +Documentation/translations/it_IT/process/maintainer-pgp-guide.rst:.. _`Finding paths to Linus`: https://pgp.cs.uu.nl/paths/79BE3E4300411886/to/C94035C21B4F2AEB.html +Documentation/translations/it_IT/process/2.Process.rst:Al termine di questo periodo, Linus Torvald dichiarerà che la finestra è +Documentation/translations/it_IT/process/2.Process.rst:il ritmo delle modifiche rallenta col tempo. Linus rilascia un nuovo +Documentation/translations/it_IT/process/2.Process.rst: Linus Torvalds. In questa fase potrebbero emergere nuovi problemi e/o +Documentation/translations/it_IT/process/2.Process.rst:del kernel: Linus Torvalds. Ma, per esempio, di tutte le 9500 patch +Documentation/translations/it_IT/process/2.Process.rst:l'1,3%) furono scelte direttamente da Linus in persona. Il progetto +Documentation/translations/it_IT/process/2.Process.rst:chiederanno a Linus di "prendere" dai loro repositori le modifiche che hanno +Documentation/translations/it_IT/process/2.Process.rst:selezionato per l'inclusione. Se Linus acconsente, il flusso di patch si +Documentation/translations/it_IT/process/2.Process.rst:principale del kernel. La quantità d'attenzione che Linus presta alle +Documentation/translations/it_IT/process/2.Process.rst:generale, Linus confida nel fatto che i manutentori di sottosistema non +Documentation/translations/it_IT/process/2.Process.rst:patch direttamente a Linus non è la via giusta. +Documentation/translations/it_IT/process/2.Process.rst:direttamente a Linus. In un tipico ciclo di sviluppo, circa il 5-10% delle +Documentation/translations/it_IT/process/volatile-considered-harmful.rst: (parole di Linus) in questo contesto; correggerla non ne varrebbe la pena e +Documentation/translations/it_IT/process/deprecated.rst:`_ +Documentation/translations/it_IT/process/deprecated.rst:circa l'errore. Linus ha un'opinione molto critica al riguardo: +Documentation/translations/it_IT/process/deprecated.rst:`_) +Documentation/translations/it_IT/process/deprecated.rst:di Linus: +Documentation/translations/it_IT/process/deprecated.rst: affrontare il giudizio di Linus, allora forse potrai usare "%px", +Documentation/translations/it_IT/process/deprecated.rst:`_" alla +Documentation/translations/it_IT/process/deprecated.rst:vettori a dimensione fissa. Questi `problemi di prestazioni `_, +Documentation/translations/it_IT/process/deprecated.rst:`_. +Documentation/translations/it_IT/process/deprecated.rst:`_, +Documentation/translations/it_IT/process/deprecated.rst:`_. +Documentation/translations/it_IT/process/6.Followthrough.rst:fatta per Linus, forse. +Documentation/devicetree/bindings/input/atmel,maxtouch.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/process/5.Posting.rst:così come lo si trova nei sorgenti git di Linus. Quando vi basate sul ramo +Documentation/translations/it_IT/process/5.Posting.rst:Linus Torvalds, e lasciare che sia lui ad integrarle,solitamente non è la +Documentation/translations/it_IT/process/5.Posting.rst:strada migliore da seguire. Linus è occupato, e ci sono dei manutentori di +Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma140.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/process/kernel-enforcement-statement.rst: - Linus Torvalds +Documentation/translations/it_IT/process/kernel-enforcement-statement.rst: - Linus Walleij +Documentation/translations/it_IT/process/howto.rst:I kernel 4.x sono amministrati da Linus Torvald, e possono essere trovati +Documentation/translations/it_IT/process/howto.rst: settimane. Durante questo periodo i manutentori possono proporre a Linus +Documentation/translations/it_IT/process/howto.rst: aggiunto. git può essere utilizzato per inviare le patch a Linus dopo che +Documentation/translations/it_IT/process/howto.rst: - Una nuova -rc viene rilasciata ogni volta che Linus reputa che gli attuali +Documentation/translations/it_IT/process/submitting-patches.rst:Linus e gli altri sviluppatori del kernel devono poter commentare +Documentation/translations/it_IT/process/submitting-patches.rst:Inoltre, un allegato MIME rende l'attività di Linus più laboriosa, diminuendo +Documentation/translations/it_IT/process/submitting-patches.rst:Dato l'alto volume di e-mail per Linus, e la lista linux-kernel, è prassi +Documentation/translations/it_IT/process/submitting-patches.rst:prefiggere il vostro oggetto con [PATCH]. Questo permette a Linus e agli +Documentation/translations/it_IT/process/submitting-patches.rst:manutentore, per poi giungere a Linus. +Documentation/translations/it_IT/process/submitting-patches.rst:E-mail di Linus Torvalds sul formato canonico di una patch: +Documentation/translations/it_IT/process/adding-syscalls.rst: - Raccomandazioni da Linus Torvalds che le chiamate di sistema x32 dovrebbero +Documentation/devicetree/bindings/display/ste,mcde.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/faraday,tve200.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/process/7.AdvancedTopics.rst:vostri rami. Citando Linus +Documentation/devicetree/bindings/net/intel,ixp4xx-hss.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/net/intel,ixp4xx-ethernet.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/sony,acx424akp.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/input/touchscreen/melfas,mms114.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/ti,nspire.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/process/4.Coding.rst:domanda ci è stata fornita da Linus nel luglio 2007: +Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/dsi-controller.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/kernel-hacking/hacking.rst:che questo venga accettato da Linus. +Documentation/translations/it_IT/kernel-hacking/hacking.rst:Linus e gli altri sviluppatori a volte cambiano i nomi delle funzioni e +Documentation/translations/it_IT/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky +Documentation/devicetree/bindings/display/panel/ilitek,ili9322.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/devicetree/bindings/display/panel/samsung,s6d16d0.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/ja_JP/stable_kernel_rules.txt: - パッチ自体か同等の修正が Linus のツリーに既に存在しなければならない。 +Documentation/translations/ja_JP/stable_kernel_rules.txt:  Linus のツリーでのコミットID を -stable へのパッチ投稿の際に引用す +Documentation/translations/ja_JP/stable_kernel_rules.txt: が Linus のツリーに入る時に自動的に stable チームに email される。 +Documentation/translations/ko_KR/howto.rst:메인라인 트리는 Linus Torvalds가 관리하며 https://kernel.org 또는 소스 +Documentation/translations/ko_KR/howto.rst: 메인테이너들은 큰 diff들을 Linus에게 제출할 수 있다. 대개 이 패치들은 +Documentation/translations/ko_KR/howto.rst: 있지 않기 때문이다. -rc1이 배포된 이후에 git를 사용하여 패치들을 Linus에게 +Documentation/translations/ko_KR/howto.rst: - 새로운 -rc는 Linus가 현재 git tree가 테스트 하기에 충분히 안정된 상태에 +Documentation/translations/zh_TW/gpio.txt: Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/zh_TW/gpio.txt: Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/zh_TW/admin-guide/bug-hunting.rst:爲了幫助Linus和其他內核開發人員, ``klogd`` 對保護故障的處理提供了大量支持。 +Documentation/devicetree/bindings/display/panel/samsung,lms380kf01.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/it_IT/kernel-hacking/locking.rst:- ``Documentation/locking/spinlocks.rst``: la guida di Linus Torvalds agli +Documentation/translations/zh_TW/process/4.Coding.rst:Linus對這個問題給出了最佳答案: +Documentation/translations/zh_TW/process/volatile-considered-harmful.rst: (Linus的話)因爲解決這個問題比保持現狀要麻煩的多。 +Documentation/devicetree/bindings/display/panel/tpo,tpg110.yaml: - Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/zh_TW/process/7.AdvancedTopics.rst:內核使用分布式版本控制始於2002年初,當時Linus首次開始使用專有的Bitkeeper應用 +Documentation/translations/zh_TW/process/7.AdvancedTopics.rst:主題外的補丁可能會影響您將來讓樹被拉取的能力。引用Linus的話: +Documentation/translations/zh_TW/process/kernel-enforcement-statement.rst: - Linus Torvalds +Documentation/translations/zh_TW/process/kernel-enforcement-statement.rst: - Linus Walleij +Documentation/translations/zh_TW/process/howto.rst: - Linus 的內核源碼樹 +Documentation/translations/zh_TW/process/howto.rst:主線樹是由Linus Torvalds 維護的。你可以在https://kernel.org 網站或者代碼 +Documentation/translations/zh_TW/process/howto.rst: 維護者可以向Linus提交大段的修改,通常這些修改已經被放到-mm內核中幾個 +Documentation/translations/zh_TW/process/howto.rst: 沒有造成內核退步的風險。在-rc1以後也可以用git向Linus提交補丁,不過所 +Documentation/translations/zh_TW/process/howto.rst: - 當Linus認爲當前的git源碼樹已經達到一個合理健全的狀態足以發布供人測試 +Documentation/translations/zh_TW/sparse.txt:Copyright 2004 Linus Torvalds +Documentation/translations/zh_TW/process/embargoed-hardware-issues.rst: - Linus Torvalds(Linux基金會院士) +Documentation/translations/ja_JP/SubmittingPatches: かの Linus Torvalds の取り扱い説明書 +Documentation/translations/ja_JP/SubmittingPatches:Linus Torvalds は Linux カーネルに入る全ての変更に対する最終的な意思決定者 +Documentation/translations/ja_JP/SubmittingPatches:必要としないパッチは Linus へ電子メールを送るか CC しなければなりません。 +Documentation/translations/ja_JP/SubmittingPatches:Linus へ送るべきです。 +Documentation/translations/ja_JP/SubmittingPatches:Linus 以外のカーネル開発者は変更に気づく必要があり、その結果、彼らはそ +Documentation/translations/ja_JP/SubmittingPatches:Linus や他のカーネル開発者はあなたが投稿した変更を読んで、コメントでき +Documentation/translations/ja_JP/SubmittingPatches:MIME 形式の添付ファイルは Linus に手間を取らせることになり、その変更を +Documentation/translations/ja_JP/SubmittingPatches:パッチを Linus へ送るときは常に #7 の手順に従ってください。 +Documentation/translations/ja_JP/SubmittingPatches:パッチが最新バージョンのカーネルに正しく適用できなければ、Linus は +Documentation/translations/ja_JP/SubmittingPatches:パッチを投稿した後は、辛抱強く待っていてください。Linus があなたのパッ +Documentation/translations/ja_JP/SubmittingPatches:チを気に入って採用すれば、Linus がリリースする次のバージョンのカーネル +Documentation/translations/ja_JP/SubmittingPatches:Linus があなたのパッチに対して何のコメントもなく不採用にすることは極め +Documentation/translations/ja_JP/SubmittingPatches:て普通のことです。それは自然な姿です。もし、Linus があなたのパッチを受 +Documentation/translations/ja_JP/SubmittingPatches:* Linus はたくさんの電子メールを受け取っているので、どさくさに紛れて見 +Documentation/translations/ja_JP/SubmittingPatches:Linus や LKML への大量の電子メールのために、サブジェクトのプレフィックスに +Documentation/translations/ja_JP/SubmittingPatches:「 [PATCH] 」を付けることが慣習となっています。これによって Linus や他の +Documentation/translations/ja_JP/SubmittingPatches:16) 「git pull」要求の送り方(Linus の電子メールから) +Documentation/translations/ja_JP/SubmittingPatches: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus +Documentation/translations/ja_JP/SubmittingPatches:セクションを Linus のコンピュータ・サイエンス101と呼ぶでしょう。 +Documentation/translations/ja_JP/SubmittingPatches:Linus Torvalds's mail on the canonical patch format: +Documentation/translations/zh_CN/process/1.Intro.rst:放入主线内核(“主线”是由Linus Torvalds维护的内核,Linux发行商将其用作基础)。 +Documentation/translations/zh_CN/process/2.Process.rst:合并窗口持续大约两周。在这段时间结束时,Linus Torvalds将声明窗口已关闭,并 +Documentation/translations/zh_CN/process/2.Process.rst:随着修复程序进入主线,补丁速度将随着时间的推移而变慢。Linus大约每周发布一次 +Documentation/translations/zh_CN/process/2.Process.rst:- 合并到主线。最终,一个成功的补丁将被合并到由LinusTorvalds管理的主线存储库 +Documentation/translations/zh_CN/process/2.Process.rst:只有一个人可以将补丁合并到主线内核存储库中:Linus Torvalds。但是,在进入 +Documentation/translations/zh_CN/process/2.Process.rst:2.6.38内核的9500多个补丁中,只有112个(大约1.3%)是由Linus自己直接选择的。 +Documentation/translations/zh_CN/process/2.Process.rst:当合并窗口打开时,顶级维护人员将要求Linus从存储库中“拉出”他们为合并选择 +Documentation/translations/zh_CN/process/2.Process.rst:的补丁。如果Linus同意,补丁流将流向他的存储库,成为主线内核的一部分。 +Documentation/translations/zh_CN/process/2.Process.rst:Linus对拉取中接收到的特定补丁的关注程度各不相同。很明显,有时他看起来很 +Documentation/translations/zh_CN/process/2.Process.rst:关注。但是一般来说,Linus相信子系统维护人员不会向上游发送坏补丁。 +Documentation/translations/zh_CN/process/2.Process.rst:显然,在这样的系统中,获取内核补丁取决于找到正确的维护者。直接向Linus发送 +Documentation/translations/zh_CN/process/2.Process.rst:发送到Linus。在典型的开发周期中,大约5-10%的补丁通过-mm 进入主线。 +Documentation/translations/zh_TW/process/submitting-patches.rst:Linus Torvalds 是決定改動能否進入 Linux 內核的最終裁決者。他的 e-mail +Documentation/translations/zh_TW/process/submitting-patches.rst:Linus 和其他的內核開發者需要閱讀和評論你提交的改動。對於內核開發者來說 +Documentation/translations/zh_TW/process/submitting-patches.rst:代碼中加評論。另外,MIME 編碼的附件會讓 Linus 多花一點時間來處理,這就 +Documentation/translations/zh_TW/process/submitting-patches.rst:由於到linus和linux內核的電子郵件流量很高,通常會在主題行前面加上[PATCH] +Documentation/translations/zh_TW/process/submitting-patches.rst:前綴. 這使Linus和其他內核開發人員更容易將補丁與其他電子郵件討論區分開。 +Documentation/translations/zh_TW/process/submitting-patches.rst: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus +Documentation/translations/zh_TW/process/submitting-patches.rst:一些維護人員(包括Linus)希望看到來自已簽名提交的請求;這增加了他們對你的 +Documentation/translations/zh_TW/process/submitting-patches.rst:請求信心。特別是,在沒有簽名標籤的情況下,Linus 不會從像 Github 這樣的公共 +Documentation/translations/zh_TW/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: +Documentation/translations/zh_CN/process/6.Followthrough.rst:了Linus。 +Documentation/translations/zh_CN/process/7.AdvancedTopics.rst:内核使用分布式版本控制始于2002年初,当时Linus首次开始使用专有的Bitkeeper应用 +Documentation/translations/zh_CN/process/7.AdvancedTopics.rst:主题外的补丁可能会影响您将来让树被拉取的能力。引用Linus的话: +Documentation/translations/zh_CN/process/5.Posting.rst:必须针对内核的特定版本准备补丁。一般来说,补丁应该基于Linus的Git树中的当前 +Documentation/translations/zh_CN/process/5.Posting.rst:可以将补丁直接发给Linus Torvalds并让他合并,但通常情况下不会这样做。Linus很 +Documentation/translations/zh_TW/process/5.Posting.rst:必須針對內核的特定版本準備補丁。一般來說,補丁應該基於Linus的Git樹中的當前 +Documentation/translations/zh_TW/process/5.Posting.rst:可以將補丁直接發給Linus Torvalds並讓他合併,但通常情況下不會這樣做。Linus很 +Documentation/translations/zh_TW/process/stable-api-nonsense.rst:你這個吸血鬼<把Andrew和Linus對吸血鬼的定義連結到這裡>)。當你的代碼加入 +Documentation/translations/zh_TW/admin-guide/README.rst: Linux是Unix作業系統的克隆版本,由Linus Torvalds在一個鬆散的網絡黑客 +Documentation/translations/zh_CN/process/volatile-considered-harmful.rst: (Linus的话)因为解决这个问题比保持现状要麻烦的多。 +Documentation/translations/zh_CN/process/4.Coding.rst:Linus对这个问题给出了最佳答案: +Documentation/translations/zh_TW/process/2.Process.rst:合併窗口持續大約兩周。在這段時間結束時,LinusTorvalds將聲明窗口已關閉,並 +Documentation/translations/zh_TW/process/2.Process.rst:隨著修復程序進入主線,補丁速度將隨著時間的推移而變慢。Linus大約每周發布一次 +Documentation/translations/zh_TW/process/2.Process.rst:- 合併到主線。最終,一個成功的補丁將被合併到由LinusTorvalds管理的主線存儲庫 +Documentation/translations/zh_TW/process/2.Process.rst:只有一個人可以將補丁合併到主線內核存儲庫中:LinusTorvalds。但是,在進入 +Documentation/translations/zh_TW/process/2.Process.rst:2.6.38內核的9500多個補丁中,只有112個(大約1.3%)是由Linus自己直接選擇的。 +Documentation/translations/zh_TW/process/2.Process.rst:當合併窗口打開時,頂級維護人員將要求Linus從存儲庫中「拉出」他們爲合併選擇 +Documentation/translations/zh_TW/process/2.Process.rst:的補丁。如果Linus同意,補丁流將流向他的存儲庫,成爲主線內核的一部分。 +Documentation/translations/zh_TW/process/2.Process.rst:Linus對拉取中接收到的特定補丁的關注程度各不相同。很明顯,有時他看起來很 +Documentation/translations/zh_TW/process/2.Process.rst:關注。但是一般來說,Linus相信子系統維護人員不會向上游發送壞補丁。 +Documentation/translations/zh_TW/process/2.Process.rst:顯然,在這樣的系統中,獲取內核補丁取決於找到正確的維護者。直接向Linus發送 +Documentation/translations/zh_TW/process/2.Process.rst:發送到Linus。在典型的開發周期中,大約5-10%的補丁通過-mm 進入主線。 +Documentation/translations/zh_CN/process/stable-api-nonsense.rst:你这个吸血鬼<把Andrew和Linus对吸血鬼的定义链接到这里>)。当你的代码加入 +Documentation/translations/zh_CN/process/kernel-enforcement-statement.rst: - Linus Torvalds +Documentation/translations/zh_CN/process/kernel-enforcement-statement.rst: - Linus Walleij +Documentation/translations/zh_CN/process/submitting-patches.rst:Linus Torvalds 是决定改动能否进入 Linux 内核的最终裁决者。他的 e-mail +Documentation/translations/zh_CN/process/submitting-patches.rst:Linus 和其他的内核开发者需要阅读和评论你提交的改动。对于内核开发者来说 +Documentation/translations/zh_CN/process/submitting-patches.rst:代码中加评论。另外,MIME 编码的附件会让 Linus 多花一点时间来处理,这就 +Documentation/translations/zh_CN/process/submitting-patches.rst:由于到linus和linux内核的电子邮件流量很高,通常会在主题行前面加上[PATCH] +Documentation/translations/zh_CN/process/submitting-patches.rst:前缀. 这使Linus和其他内核开发人员更容易将补丁与其他电子邮件讨论区分开。 +Documentation/translations/zh_CN/process/submitting-patches.rst: git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus +Documentation/translations/zh_CN/process/submitting-patches.rst:一些维护人员(包括Linus)希望看到来自已签名提交的请求;这增加了他们对你的 +Documentation/translations/zh_CN/process/submitting-patches.rst:请求信心。特别是,在没有签名标签的情况下,Linus 不会从像 Github 这样的公共 +Documentation/translations/zh_CN/process/submitting-patches.rst:Linus Torvalds's mail on the canonical patch format: +Documentation/translations/zh_CN/process/howto.rst: - Linus 的内核源码树 +Documentation/translations/zh_CN/process/howto.rst:主线树是由Linus Torvalds 维护的。你可以在https://kernel.org 网站或者代码 +Documentation/translations/zh_CN/process/howto.rst: 维护者可以向Linus提交大段的修改,通常这些修改已经被放到-mm内核中几个 +Documentation/translations/zh_CN/process/howto.rst: 没有造成内核退步的风险。在-rc1以后也可以用git向Linus提交补丁,不过所 +Documentation/translations/zh_CN/process/howto.rst: - 当Linus认为当前的git源码树已经达到一个合理健全的状态足以发布供人测试 +Documentation/translations/zh_TW/process/1.Intro.rst:放入主線內核(「主線」是由Linus Torvalds維護的內核,Linux發行商將其用作基礎)。 +Documentation/translations/zh_CN/process/embargoed-hardware-issues.rst: - Linus Torvalds(Linux基金会院士) +Documentation/translations/zh_CN/kernel-hacking/hacking.rst:``include/asm/unistd.h`` 和 ``arch/kernel/entry.S`` 文件里,而且更容易被Linus +Documentation/translations/zh_CN/kernel-hacking/hacking.rst:Linus和其他开发人员有时会更改开发内核中的函数或结构体名称;这样做不仅是为了 +Documentation/translations/zh_CN/kernel-hacking/hacking.rst: /* Uh, actually Linus it is I who cannot spell. Too much murky +Documentation/translations/zh_TW/process/6.Followthrough.rst:了Linus。 +Documentation/translations/zh_CN/oops-tracing.txt:注意:以下来自于Linus的邮件适用于2.4内核。 我因为历史原因保留了它,并且因为其中 +Documentation/translations/zh_CN/oops-tracing.txt:From: Linus Torvalds +Documentation/translations/zh_CN/oops-tracing.txt: Linus +Documentation/translations/zh_CN/oops-tracing.txt:为了帮助Linus和其它内核开发者,klogd纳入了大量的支持来处理保护错误。为了拥有对 +Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:Linus Torvalds和主要的Linux內核開發人員希望看到一些問題儘快得到解決,因此在 +Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:Linux 首席開發者 Linus Torvalds 認爲 Linux 內核永遠不應惡化,這就是爲什麼他 +Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:這可能是一種罕見的、可以讓 Linus Torvalds 參與進來的情況。 +Documentation/translations/zh_TW/admin-guide/reporting-issues.rst:重問題)才一定會得到解決。如果維護者或其他人都失敗了,Linus Torvalds 他自己 +Documentation/translations/zh_CN/admin-guide/README.rst: Linux是Unix操作系统的克隆版本,由Linus Torvalds在一个松散的网络黑客 +Documentation/translations/zh_CN/gpio.txt: Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/zh_CN/gpio.txt: Linus Walleij <linus.walleij@linaro.org> +Documentation/translations/ja_JP/howto.rst:4.x カーネルは Linus Torvalds によってメンテナンスされ、 +Documentation/translations/ja_JP/howto.rst: この期間中に、メンテナ達は Linus に大きな差分を送ることができます。 +Documentation/translations/ja_JP/howto.rst: Linus へパッチを送付するのに git を使うこともできますが、パッチは +Documentation/translations/ja_JP/howto.rst: - 新しい -rc は Linus が、最新の git ツリーがテスト目的であれば十分 +Documentation/translations/zh_CN/maintainer/pull-requests.rst:来自Greg Kroah Hartman和Linus Torvalds在LKML上的评论。Jonathan Corbet和Mauro +Documentation/translations/zh_CN/maintainer/pull-requests.rst:Linus只接受基于签名过的标记的拉取请求。其他维护者可能会有所不同。 +Documentation/translations/zh_CN/maintainer/pull-requests.rst:正如Linus所说:: +Documentation/translations/zh_CN/maintainer/pull-requests.rst: Linus +Documentation/translations/zh_CN/maintainer/pull-requests.rst: 例子中指向了我从Linus的树分叉的地方,通常是-rc发布)的差异,并去使用 +Documentation/translations/zh_CN/maintainer/pull-requests.rst:Linus回复说他倾向于 ``git://`` 协议。其他维护者可能有不同的偏好。另外,请注意 +Documentation/translations/zh_CN/maintainer/pull-requests.rst:任何必要特定子系统的列表。对Linus的拉取请求通常有如下主题行:: +Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:合并窗口麻烦的一个常见原因是,Linus收到了一个明显在拉取请求发送之前不久才变根 +Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:尤其如此:Linus坚信他更愿意看到合并冲突,而不是不必要的反向合并。看到冲突 +Documentation/translations/zh_CN/maintainer/rebasing-and-merging.rst:的一步是在拉取请求中提示Linus会发生冲突;如果啥都没说则表明您的分支可以正常 +Documentation/translations/zh_TW/oops-tracing.txt:注意:以下來自於Linus的郵件適用於2.4內核。 我因爲歷史原因保留了它,並且因爲其中 +Documentation/translations/zh_TW/oops-tracing.txt:From: Linus Torvalds +Documentation/translations/zh_TW/oops-tracing.txt: Linus +Documentation/translations/zh_TW/oops-tracing.txt:爲了幫助Linus和其它內核開發者,klogd納入了大量的支持來處理保護錯誤。爲了擁有對 +Documentation/translations/zh_CN/dev-tools/sparse.rst:Copyright 2004 Linus Torvalds +Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:Linus Torvalds和主要的Linux内核开发人员希望看到一些问题尽快得到解决,因此在 +Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:Linux 首席开发者 Linus Torvalds 认为 Linux 内核永远不应恶化,这就是为什么他 +Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:这可能是一种罕见的、可以让 Linus Torvalds 参与进来的情况。 +Documentation/translations/zh_CN/admin-guide/reporting-issues.rst:重问题)才一定会得到解决。如果维护者或其他人都失败了,Linus Torvalds 他自己 +Documentation/translations/ja_JP/stable_api_nonsense.txt:と Linus からのコメント<Andrew と Linus のコメントへのリンクをこ +Documentation/translations/zh_CN/admin-guide/bug-hunting.rst:为了帮助Linus和其他内核开发人员, ``klogd`` 对保护故障的处理提供了大量支持。 +drivers/clk/clk-gemini.c: * Copyright (c) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/clk/clk-nomadik.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/net/ethernet/cortina/gemini.h: * Copytight (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/net/ethernet/cortina/gemini.c: * Linus Walleij <linus.walleij@linaro.org> +drivers/net/ethernet/cortina/gemini.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/net/dsa/vitesse-vsc73xx-spi.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> +drivers/net/dsa/vitesse-vsc73xx-spi.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/net/dsa/vitesse-vsc73xx-platform.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> +drivers/net/dsa/realtek-smi-core.h: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/net/dsa/realtek-smi-core.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/net/dsa/rtl8366.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/net/dsa/vitesse-vsc73xx-core.c: * Copyright (C) 2018 Linus Wallej <linus.walleij@linaro.org> +drivers/net/dsa/vitesse-vsc73xx-core.c:MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); +drivers/clk/versatile/clk-impd1.c: * Copyright (C) 2012-2013 Linus Walleij +drivers/clk/versatile/clk-impd1.c:MODULE_AUTHOR("Linus Walleij <linusw@kernel.org>"); +drivers/clk/versatile/clk-versatile.c: * Copyright (C) 2012 Linus Walleij +drivers/net/dsa/rtl8366rb.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/clk/versatile/clk-icst.c: * Copyright (C) 2012-2015 Linus Walleij +drivers/net/hamradio/baycom_ser_fdx.c: * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall +drivers/net/hamradio/baycom_epp.c: * 0.5 03.08.1999 adapt to Linus' new __setup/__initcall +drivers/net/hamradio/baycom_ser_hdx.c: * 0.7 03.08.1999 adapt to Linus' new __setup/__initcall +drivers/net/hamradio/baycom_par.c: * 0.6 03.08.1999 adapt to Linus' new __setup/__initcall +drivers/net/sb1000.c: Linus changed the timer interface. Should work on all recent +drivers/clk/ux500/reset-prcc.c: * Copyright (C) 2021 Linus Walleij <linus.walleij@linaro.org> +drivers/soc/versatile/soc-realview.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/soc/versatile/soc-integrator.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/soc/gemini/soc-gemini.c: * Author: Linus Walleij <linus.walleij@linaro.org> +drivers/clocksource/nomadik-mtu.c: * Copyright (C) 2010 Linus Walleij for ST-Ericsson +include/asm-generic/tlb.h: * Based on code from mm/memory.c Copyright Linus Torvalds and others. +drivers/clocksource/timer-fttmr010.c: * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> +drivers/clocksource/timer-ixp4xx.c: * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org> +drivers/clocksource/clksrc-dbx500-prcmu.c: * plat-nomadik/timer.c Linus Walleij <linus.walleij@stericsson.com> +fs/bfs/inode.c: * From fs/minix, Copyright (C) 1991, 1992 Linus Torvalds. +fs/ext2/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/inode.c: * Linus? +fs/hugetlbfs/inode.c: * Copyright (C) 2002 Linus Torvalds. +arch/x86/kernel/irq_64.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/x86/kernel/irq_32.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/x86/kernel/dumpstack_32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/kernel/process_64.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/kernel/dumpstack.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/dumpstack.c: * There are a couple of reasons for the 2/3rd prologue, courtesy of Linus: +arch/x86/kernel/process_32.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/kernel/head_32.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/time.c: * Copyright (c) 1991,1992,1995 Linus Torvalds +arch/x86/kernel/vm86_32.c: * Copyright (C) 1994 Linus Torvalds +arch/x86/kernel/fpu/core.c: * Copyright (C) 1994 Linus Torvalds +arch/x86/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/cpu/bugs.c: * Copyright (C) 1994 Linus Torvalds +arch/x86/kernel/ioport.c: * by Linus. 32/64 bits code unification by Miguel Botón. +arch/x86/kernel/nmi.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/dumpstack_64.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/kernel/ldt.c: * Copyright (C) 1992 Krishna Balasubramanian and Linus Torvalds +arch/x86/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/math-emu/README:the original Linux math emulator by Linus Torvalds. +arch/x86/math-emu/README: [ Linus' note: I changed look-ahead to be the default under linux, as +arch/x86/math-emu/README:Linus Torvalds +arch/x86/math-emu/fpu_entry.c: Changes to support them provided by Linus Torvalds. */ +net/batman-adv/bat_v.h: * Marek Lindner, Linus Lüssing +net/batman-adv/bat_v.c: * Linus Lüssing, Marek Lindner +net/batman-adv/multicast.h: * Linus Lüssing +net/batman-adv/multicast.c: * Linus Lüssing +net/batman-adv/bat_v_elp.h: * Linus Lüssing, Marek Lindner +net/batman-adv/bat_v_elp.c: * Linus Lüssing, Marek Lindner +net/batman-adv/bat_algo.h: * Marek Lindner, Linus Lüssing +fs/ext2/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/ext2.h: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext2/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/boot.h: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/tty.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/string.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/video-bios.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/main.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/x86/boot/a20.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/tools/build.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/x86/boot/video.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/header.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/video-vesa.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/video-mode.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/printf.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/bitops.h: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/pmjump.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/memory.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/video-vga.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/version.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/copy.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/cpu.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/video.h: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/pm.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/cpucheck.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/edd.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/apm.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/cmdline.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/boot/compressed/head_32.S: * Copyright (C) 1991, 1992, 1993 Linus Torvalds +arch/x86/boot/compressed/head_64.S: * Copyright (C) 1991, 1992, 1993 Linus Torvalds +arch/x86/lib/usercopy_64.c: * Copyright 1997 Linus Torvalds +arch/x86/lib/delay.c: * Copyright (C) 1993 Linus Torvalds +arch/x86/lib/getuser.S: * (C) Copyright 1998 Linus Torvalds +arch/x86/lib/usercopy_32.c: * Copyright 1997 Linus Torvalds +arch/x86/lib/putuser.S: * (C) Copyright 2005 Linus Torvalds +arch/x86/ia32/ia32_aout.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds +arch/x86/ia32/ia32_signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/entry/entry_32.S: * Copyright (C) 1991,1992 Linus Torvalds +arch/x86/entry/entry_64.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/include/asm/hw_irq.h: * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar +arch/x86/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. +arch/x86/include/asm/io.h: * Linus +arch/x86/include/asm/sync_bitops.h: * Copyright 1992, Linus Torvalds. +arch/x86/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/x86/include/asm/irq.h: * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar +arch/x86/include/asm/stacktrace.h: * Copyright (C) 1991, 1992 Linus Torvalds +arch/x86/include/asm/fpu/api.h: * Copyright (C) 1994 Linus Torvalds +arch/x86/include/uapi/asm/vm86.h: * Linus +arch/x86/realmode/rm/trampoline_64.S: * Trampoline.S Derived from Setup.S by Linus Torvalds +arch/x86/realmode/rm/trampoline_32.S: * Trampoline.S Derived from Setup.S by Linus Torvalds +arch/x86/entry/vdso/vdso32-setup.c: * (C) Copyright 2002 Linus Torvalds +arch/x86/mm/init_64.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/mm/tlb.c: * c/o Linus Torvalds. +arch/x86/mm/init_32.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/x86/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +fs/hfs/inode.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds +fs/hfs/catalog.c: * linux/fs/inode.c Copyright (C) 1991, 1992 Linus Torvalds +fs/hfs/catalog.c: * re-shamelessly stolen Copyright (C) 1997 Linus Torvalds +fs/hfs/super.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds +fs/hfs/dir.c: * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds +fs/buffer.c: * Copyright (C) 1991, 1992, 2002 Linus Torvalds +fs/open.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/nfs/dir.c: * Following Linus comments on my original hack, this version +fs/nfs/read.c: * Partial copy of Linus' read cache modifications to fs/nfs/file.c +fs/nfs/file.c: * Total rewrite of read side for new NFS buffer cache.. Linus. +fs/nfs/nfsroot.c: * Linus so that I don' always have to cleanup +fs/char_dev.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/proc/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/proc/kmsg.c: * Copyright (C) 1992 by Linus Torvalds +fs/proc/generic.c: * Copyright (C) 1991, 1992 Linus Torvalds. +fs/proc/root.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/proc/base.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/jfs/acl.c: * Copyright (C) Linus Torvalds, 1991, 1992 +fs/proc/array.c: * Copyright (C) 1992 by Linus Torvalds +fs/inode.c: * (C) 1997 Linus Torvalds +fs/splice.c: * Named by Larry McVoy, original implementation from Linus, extended by +fs/splice.c: * Copyright (C) 2005-2006 Linus Torvalds +fs/mpage.c: * Copyright (C) 2002, Linus Torvalds. +fs/readdir.c: * Copyright (C) 1995 Linus Torvalds +mm/vmscan.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +fs/affs/inode.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/affs/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/minix/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/affs/dir.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/affs/super.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/minix/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/affs/namei.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/minix/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/minix/bitmap.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/minix/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/affs/file.c: * (C) 1991 Linus Torvalds - minix filesystem +mm/fadvise.c: * Copyright (C) 2002, Linus Torvalds +fs/attr.c: * Copyright (C) 1991, 1992 Linus Torvalds +mm/readahead.c: * Copyright (C) 2002, Linus Torvalds +fs/ioctl.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/befs/ChangeLog:* Anton Altaparmakov figured out (by asking Linus :) ) what was causing the +fs/exec.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/symlink.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/indirect.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/indirect.c: * Linus? +fs/ext4/fsync.c: * linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/ext4.h: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/readpage.c: * Copyright (C) 2002, Linus Torvalds. +fs/ext4/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ext4/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ocfs2/dlmfs/dlmfs.c: * Copyright (C) 2000 Linus Torvalds. +fs/ocfs2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/direct-io.c: * Copyright (C) 2002, Linus Torvalds. +fs/sysv/ialloc.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/sysv/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/sysv/balloc.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/sysv/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +mm/swapfile.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +mm/truncate.c: * Copyright (C) 2002, Linus Torvalds +fs/sysv/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/sysv/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/sysv/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +mm/vmalloc.c: * Copyright (C) 1993 Linus Torvalds +fs/read_write.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/romfs/super.c: * Copyright © 1991, 1992 Linus Torvalds +fs/isofs/inode.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/isofs/namei.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/isofs/dir.c: * (C) 1991 Linus Torvalds - minix filesystem +fs/file_table.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/cramfs/uncompress.c: * (C) Copyright 1999 Linus Torvalds +fs/cramfs/inode.c: * Copyright (C) 1999 Linus Torvalds. +mm/msync.c: * Copyright (C) 1994-1999 Linus Torvalds +fs/pipe.c: * Copyright (C) 1991, 1992, 1999 Linus Torvalds +fs/fs-writeback.c: * Copyright (C) 2002, Linus Torvalds. +mm/mlock.c: * (C) Copyright 1995 Linus Torvalds +fs/namespace.c: * Based on code from fs/super.c, copyright Linus Torvalds and others. +mm/mremap.c: * (C) Copyright 1996 Linus Torvalds +fs/signalfd.c: * Copyright (C) 2003 Linus Torvalds +mm/highmem.c: * based on Linus' idea. +fs/select.c: * patches by Peter MacDonald. Heavily edited by Linus. +mm/vmstat.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +fs/nilfs2/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/nilfs2/dir.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/nilfs2/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +mm/page_io.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +mm/memory.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +mm/memory.c: * things wanted, and it should be easy to implement. - Linus +mm/memory.c: * pages started 02.12.91, seems to work. - Linus. +mm/filemap.c: * Copyright (C) 1994-1999 Linus Torvalds +mm/page-writeback.c: * Copyright (C) 2002, Linus Torvalds. +net/ipv6/mcast_snoop.c: * Copyright (C) 2015: Linus Lüssing <linus.luessing@c0d3.blue> +mm/mincore.c: * Copyright (C) 1994-2006 Linus Torvalds +mm/shmem.c: * Copyright (C) 2000 Linus Torvalds. +net/core/skbuff.c: * Linus Torvalds : Better skb_clone. +net/core/skbuff.c: * Alan Cox : Added all the changed routines Linus +mm/pgtable-generic.c: * Copyright (C) 2010 Linus Torvalds +net/core/datagram.c: * Linus Torvalds : BSD semantic fixes. +mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +net/dsa/tag_rtl4_a.c: * Copyright (c) 2020 Linus Walleij <linus.walleij@linaro.org> +mm/madvise.c: * Copyright (C) 1999 Linus Torvalds +mm/mprotect.c: * (C) Copyright 1994 Linus Torvalds +mm/swap_state.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +mm/swap.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +mm/page_alloc.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +net/unix/af_unix.c: * Linus Torvalds : Assorted bug cures. +mm/early_ioremap.c: * (C) Copyright 1995 1996, 2014 Linus Torvalds +fs/stat.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/adfs/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/dcache.c: * with heavy changes by Linus Torvalds +fs/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/binfmt_aout.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds +net/ipv4/tcp_input.c: * Linus Torvalds, +net/ipv4/arp.c: * Ack spit, Linus how did you allow that +net/ipv4/ip_input.c: * Linus Torvalds : More robustness checks +net/ipv4/ip_input.c: * Linus Torvalds/ : Memory leakage on fragmentation +net/ipv4/tcp_minisocks.c: * Linus Torvalds, +net/ipv4/tcp_output.c: * Linus Torvalds, +net/ipv4/tcp_output.c: * Linus Torvalds : send_delayed_ack +net/ipv4/tcp.c: * Linus Torvalds, +net/ipv4/tcp.c: * Linus : Rewrote tcp_read() and URG handling +net/ipv4/tcp.c: * Linus Torvalds : Fin/Shutdown & copied_seq changes. +net/ipv4/tcp.c: * Linus Torvalds : Fixed BSD port reuse to work first syn +net/ipv4/route.c: * Linus Torvalds, <Linus.Torvalds@helsinki.fi> +net/ipv4/route.c: * Linus Torvalds : Rewrote bits to be sensible +net/ipv4/tcp_timer.c: * Linus Torvalds, +fs/filesystems.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/powerpc/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/powerpc/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/powerpc/kernel/ptrace/ptrace32.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds +arch/powerpc/kernel/ptrace/ptrace.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds +arch/powerpc/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/powerpc/kernel/iomap.c: * (C) Copyright 2004 Linus Torvalds +arch/powerpc/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/powerpc/kernel/process.c: * Copyright (C) 1995 Linus Torvalds +arch/powerpc/kernel/signal_64.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ramfs/inode.c: * Copyright (C) 2000 Linus Torvalds. +fs/ufs/inode.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/powerpc/platforms/cell/setup.c: * Copyright (C) 1995 Linus Torvalds +fs/ramfs/file-mmu.c: * Copyright (C) 2000 Linus Torvalds. +fs/ufs/super.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/ufs/file.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/powerpc/platforms/pseries/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/powerpc/platforms/pseries/firmware.c: * Copyright (C) 1995 Linus Torvalds +fs/ufs/namei.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/powerpc/platforms/8xx/m8xx_setup.c: * Copyright (C) 1995 Linus Torvalds +arch/powerpc/platforms/powermac/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/powerpc/platforms/chrp/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/powerpc/platforms/chrp/setup.c: * Copyright (C) 1995 Linus Torvalds +fs/fcntl.c: * Copyright (C) 1991, 1992 Linus Torvalds +fs/binfmt_flat.c: * Copyright (C) 1991, 1992, 1996 Linus Torvalds +arch/alpha/lib/divide.S: * (C) 1995 Linus Torvalds +net/socket.c: * Linus : Argh. removed all the socket allocation +arch/mips/kernel/signal-common.h: * Copyright (C) 1991, 1992 Linus Torvalds +arch/mips/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/mips/kernel/ptrace32.c: * Copyright (C) Linus Torvalds +arch/mips/kernel/signal_o32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/mips/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/mips/kernel/signal32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/mips/kernel/ptrace.c: * Copyright (C) Linus Torvalds +arch/mips/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/alpha/lib/csum_partial_copy.c: * (C) Copyright 1996 Linus Torvalds +arch/alpha/lib/udelay.c: * Copyright (C) 1993, 2000 Linus Torvalds +arch/mips/boot/compressed/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/alpha/lib/memcpy.c: * Copyright (C) 1995 Linus Torvalds +arch/alpha/lib/memset.S: * (C) Copyright 1996 Linus Torvalds +arch/alpha/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/alpha/kernel/process.c: * Copyright (C) 1995 Linus Torvalds +arch/mips/jazz/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/alpha/kernel/sys_jensen.c: * Copyright (C) 1995 Linus Torvalds +arch/alpha/kernel/rtc.c: * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds +arch/alpha/kernel/irq.c: * Copyright (C) 1995 Linus Torvalds +arch/alpha/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/alpha/kernel/time.c: * Copyright (C) 1991, 1992, 1995, 1999, 2000 Linus Torvalds +arch/alpha/kernel/osf_sys.c: * Copyright (C) 1995 Linus Torvalds +arch/mips/lib/iomap-pci.c: * (C) Copyright 2004 Linus Torvalds +arch/alpha/kernel/irq_impl.h: * Copyright (C) 1995 Linus Torvalds +arch/alpha/kernel/ptrace.c:/* edited by Linus Torvalds */ +arch/alpha/kernel/signal.c: * Copyright (C) 1995 Linus Torvalds +arch/alpha/kernel/traps.c: * (C) Copyright 1994 Linus Torvalds +arch/alpha/lib/fpreg.c: * (C) Copyright 1998 Linus Torvalds +arch/alpha/boot/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/alpha/boot/bootpz.c: * based significantly on the arch/alpha/boot/main.c of Linus Torvalds +arch/alpha/boot/main.c: * Copyright (C) 1994, 1995 Linus Torvalds +arch/mips/dec/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/alpha/boot/bootp.c: * based significantly on the arch/alpha/boot/main.c of Linus Torvalds +arch/mips/include/asm/mach-generic/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors +arch/mips/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/mips/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +arch/mips/sni/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/alpha/include/asm/bitops.h: * Copyright 1994, Linus Torvalds. +arch/alpha/include/asm/mmu_context.h: * Copyright (C) 1996, Linus Torvalds +arch/alpha/include/asm/irq.h: * (C) 1994 Linus Torvalds +arch/alpha/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds +arch/alpha/include/asm/processor.h: * Copyright (C) 1994 Linus Torvalds +arch/alpha/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/arm/kernel/tcm.c: * Author: Linus Walleij <linus.walleij@stericsson.com> +arch/arm/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/arm/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/arm/kernel/ptrace.c: * edited by Linus Torvalds +arch/arm/kernel/process.c: * Original Copyright (C) 1995 Linus Torvalds +arch/arm/kernel/reboot.c: * Original Copyright (C) 1995 Linus Torvalds +arch/arm/kernel/traps.c: * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds +arch/arm/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts: * Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org> +arch/arm/lib/getuser.S: * Idea from x86 version, (C) Copyright 1998 Linus Torvalds +arch/arm/lib/putuser.S: * Idea from x86 version, (C) Copyright 1998 Linus Torvalds +arch/arm/mach-realview/realview-dt.c: * Author: Linus Walleij <linus.walleij@linaro.org> +arch/arm/mach-realview/platsmp-dt.c: * Copyright (C) 2015 Linus Walleij +arch/arm/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/arm/mm/fault-armv.c: * Copyright (C) 1995 Linus Torvalds +arch/arm/mm/kasan_init.c: * Author: Linus Walleij <linus.walleij@linaro.org> +arch/arm/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +arch/arm/mm/tcm.h: * Author: Linus Walleij <linus.walleij@stericsson.com> +arch/arm/mm/alignment.c: * Copyright (C) 1995 Linus Torvalds +arch/arm/include/asm/tcm.h: * Author: Linus Walleij <linus.walleij@stericsson.com> +arch/arm/include/asm/bitops.h: * Linus Torvalds (test_bit). +arch/arm/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors +arch/alpha/mm/init.c: * Copyright (C) 1995 Linus Torvalds +arch/ia64/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/ia64/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/ia64/include/asm/elf.h: * place to do this, but we should discuss this with Linus once we can +arch/powerpc/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors +arch/powerpc/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/powerpc/mm/pgtable_64.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/init_64.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/book3s32/mmu_context.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/book3s32/tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/fault.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/um/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/powerpc/mm/book3s32/mmu.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/mmu_decl.h: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/mem.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/init_32.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/init-common.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/book3s64/hash_tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/pgtable_32.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/pgtable.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/nohash/fsl_book3e.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/nohash/40x.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/nohash/44x.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/powerpc/mm/nohash/tlb.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/sh/kernel/process_32.c: * Copyright (C) 1995 Linus Torvalds +arch/sh/kernel/dumpstack.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/sh/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/sh/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/xtensa/kernel/setup.c: * Copyright (C) 1995 Linus Torvalds +arch/xtensa/kernel/irq.c: * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar +arch/xtensa/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/sh/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/sh/mm/init.c: * Copyright (C) 1995 Linus Torvalds +arch/sh/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +arch/sh/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/microblaze/kernel/ptrace.c: * Copyright (C) Linus Torvalds +arch/microblaze/kernel/signal.c: * Copyright (C) 1991,1992 Linus Torvalds +arch/microblaze/mm/fault.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/microblaze/mm/mmu_context.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/h8300/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. +arch/h8300/include/asm/thread_info.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/microblaze/mm/pgtable.c: * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds +arch/microblaze/pci/iomap.c: * (C) Copyright 2004 Linus Torvalds +arch/h8300/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/nios2/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/nios2/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/arm64/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/arm64/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +arch/sparc/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/sparc/kernel/ptrace_64.c: * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson, +arch/sparc/kernel/signal_32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/sparc/kernel/wof.S: * to see what happens. I can hear Linus now +arch/sparc/kernel/ptrace_32.c: * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson, +arch/sparc/kernel/signal32.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/sparc/kernel/signal_64.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/sparc/lib/memcpy.S: * Copyright (C) 1995 Linus Torvalds (Linus.Torvalds@helsinki.fi) +arch/sparc/lib/checksum_32.S: * Copyright(C) 1995 Linus Torvalds +arch/sparc/lib/copy_user.S: * Copyright(C) 1995 Linus Torvalds +arch/sparc/lib/checksum_64.S: * Copyright(C) 1995 Linus Torvalds +arch/sparc/include/asm/uaccess_64.h: * "For historical reasons, these macros are grossly misnamed." -Linus +arch/sparc/include/asm/checksum_64.h: * Copyright(C) 1995 Linus Torvalds +arch/sparc/include/asm/thread_info_32.h: * - Incorporating suggestions made by Linus Torvalds and Dave Miller +arch/sparc/include/asm/mmu_context_64.h:/* Derived heavily from Linus's Alpha/AXP ASN code... */ +arch/sparc/include/asm/checksum_32.h: * Copyright(C) 1995 Linus Torvalds +arch/sparc/include/asm/uaccess_32.h: * "For historical reasons, these macros are grossly misnamed." -Linus +arch/openrisc/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/arm64/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/arm64/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/arm64/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/arm64/kernel/ptrace.c: * edited by Linus Torvalds +arch/arm64/kernel/process.c: * Original Copyright (C) 1995 Linus Torvalds +arch/parisc/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/s390/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/s390/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/s390/kernel/setup.c: * Copyright (C) 1995, Linus Torvalds +arch/s390/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/s390/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/s390/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/s390/kernel/compat_signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/s390/include/asm/pgalloc.h: * Copyright (C) 1994 Linus Torvalds +arch/s390/include/asm/timex.h: * Copyright (C) 1992, Linus Torvalds +arch/s390/include/asm/delay.h: * Copyright (C) 1993 Linus Torvalds +arch/s390/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds +arch/s390/include/asm/cache.h: * Copyright (C) 1992, Linus Torvalds +arch/s390/include/asm/processor.h: * Copyright (C) 1994, Linus Torvalds +arch/s390/mm/init.c: * Copyright (C) 1995 Linus Torvalds +arch/s390/mm/fault.c: * Copyright (C) 1995 Linus Torvalds +arch/riscv/boot/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/parisc/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/parisc/kernel/irq.c: * Copyright (C) 1992 Linus Torvalds +arch/parisc/kernel/setup.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/parisc/kernel/processor.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/parisc/kernel/traps.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/parisc/Makefile:# Copyright (C) 1994 by Linus Torvalds +arch/parisc/mm/init.c: * Copyright (C) 1995 Linus Torvalds +arch/parisc/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors +arch/parisc/include/asm/processor.h: * Copyright (C) 1994 Linus Torvalds +arch/parisc/lib/delay.c: * Copyright (C) 1993 Linus Torvalds +arch/parisc/mm/ioremap.c: * (C) Copyright 1995 1996 Linus Torvalds +.mailmap:Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> +.mailmap:Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@web.de> +arch/m68k/install.sh:# Copyright (C) 1995 by Linus Torvalds +arch/m68k/68000/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/m68k/kernel/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/m68k/kernel/time.c: * Copyright (C) 1991, 1992, 1995 Linus Torvalds +arch/m68k/kernel/ptrace.c: * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds +arch/m68k/kernel/signal.c: * Copyright (C) 1991, 1992 Linus Torvalds +arch/m68k/kernel/syscalltable.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/m68k/coldfire/entry.S: * Copyright (C) 1991, 1992 Linus Torvalds +arch/m68k/include/asm/bitops.h: * Copyright 1992, Linus Torvalds. +arch/m68k/include/asm/ide.h: * Copyright (C) 1994-1996 Linus Torvalds & authors +arch/m68k/include/asm/bugs.h: * Copyright (C) 1994 Linus Torvalds diff --git a/crates/anstyle-svg/tests/term.rs b/crates/anstyle-svg/tests/term.rs new file mode 100644 index 00000000..bf68505a --- /dev/null +++ b/crates/anstyle-svg/tests/term.rs @@ -0,0 +1,13 @@ +#[test] +fn rainbow() { + let input = std::fs::read_to_string("tests/rainbow.vte").unwrap(); + let actual = anstyle_svg::Term::new().render_svg(&input); + snapbox::assert_data_eq!(actual, snapbox::file!["rainbow.svg": Text].raw()); +} + +#[test] +fn rg_linus() { + let input = std::fs::read_to_string("tests/rg_linus.vte").unwrap(); + let actual = anstyle_svg::Term::new().render_svg(&input); + snapbox::assert_data_eq!(actual, snapbox::file!["rg_linus.svg": Text].raw()); +} diff --git a/crates/anstyle-syntect/CHANGELOG.md b/crates/anstyle-syntect/CHANGELOG.md index 184bf48b..c87ce393 100644 --- a/crates/anstyle-syntect/CHANGELOG.md +++ b/crates/anstyle-syntect/CHANGELOG.md @@ -7,9 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.0.3] - 2024-10-24 + ### Compatibility -- Update MSRV to 1.70.0 +- Update MSRV to 1.66 + +## [1.0.2] - 2024-07-25 + +## [1.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 ## [1.0.0] - 2023-04-13 @@ -28,7 +38,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-10-13 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v1.0.3...HEAD +[1.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v1.0.2...anstyle-syntect-v1.0.3 +[1.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v1.0.1...anstyle-syntect-v1.0.2 +[1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v1.0.0...anstyle-syntect-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v0.2.0...anstyle-syntect-v1.0.0 [0.2.0]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v0.1.2...anstyle-syntect-v0.2.0 [0.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-syntect-v0.1.1...anstyle-syntect-v0.1.2 diff --git a/crates/anstyle-syntect/Cargo.toml b/crates/anstyle-syntect/Cargo.toml index 4071a483..8fac6581 100644 --- a/crates/anstyle-syntect/Cargo.toml +++ b/crates/anstyle-syntect/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-syntect" -version = "1.0.0" +version = "1.0.3" description = "Adapt between syntect and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "syntect"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,7 +24,12 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } syntect = { version = "5.0.0", default-features = false } + +[target.'cfg(any())'.dependencies] +thiserror = "1.0.2" # HACK: bad minimal dep in syntect + +[lints] +workspace = true diff --git a/crates/anstyle-syntect/README.md b/crates/anstyle-syntect/README.md index 81d68efe..5bc2bd02 100644 --- a/crates/anstyle-syntect/README.md +++ b/crates/anstyle-syntect/README.md @@ -1,6 +1,6 @@ # anstyle-syntect -> Convert from color styling types to [`ansi_term`](https://lib.rs/syntect) color types +> Convert between [`syntect`](https://lib.rs/syntect) highlighting and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-syntect.svg) diff --git a/crates/anstyle-syntect/src/lib.rs b/crates/anstyle-syntect/src/lib.rs index a3fc77d7..083209a8 100644 --- a/crates/anstyle-syntect/src/lib.rs +++ b/crates/anstyle-syntect/src/lib.rs @@ -1,19 +1,12 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn syntect_to_anstyle(self) -> anstyle::Style; -} +//! Convert between [`syntect`](https://lib.rs/syntect) highlighting and +//! [generic styling types][anstyle::Style] -impl sealed::Sealed for syntect::highlighting::Style {} - -impl Ext for syntect::highlighting::Style { - fn syntect_to_anstyle(self) -> anstyle::Style { - to_anstyle(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Convert highlighting style to general style pub fn to_anstyle(style: syntect::highlighting::Style) -> anstyle::Style { anstyle::Style::new() .fg_color(Some(to_anstyle_color(style.foreground))) @@ -21,10 +14,12 @@ pub fn to_anstyle(style: syntect::highlighting::Style) -> anstyle::Style { .effects(to_anstyle_effects(style.font_style)) } +/// Convert highlighting color to general color pub fn to_anstyle_color(color: syntect::highlighting::Color) -> anstyle::Color { anstyle::RgbColor(color.r, color.g, color.b).into() } +/// Convert highlighting style to general effects pub fn to_anstyle_effects(style: syntect::highlighting::FontStyle) -> anstyle::Effects { let mut effects = anstyle::Effects::new(); diff --git a/crates/anstyle-termcolor/CHANGELOG.md b/crates/anstyle-termcolor/CHANGELOG.md index 0288e489..0ac4791b 100644 --- a/crates/anstyle-termcolor/CHANGELOG.md +++ b/crates/anstyle-termcolor/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.1.3] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [1.1.2] - 2024-07-25 + +## [1.1.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + ## [1.1.0] - 2023-09-12 ### Compatibility @@ -38,7 +52,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-05-18 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.1.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.1.3...HEAD +[1.1.3]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.1.2...anstyle-termcolor-v1.1.3 +[1.1.2]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.1.1...anstyle-termcolor-v1.1.2 +[1.1.1]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.1.0...anstyle-termcolor-v1.1.1 [1.1.0]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v1.0.0...anstyle-termcolor-v1.1.0 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v0.3.0...anstyle-termcolor-v1.0.0 [0.3.0]: https://github.com/rust-cli/anstyle/compare/anstyle-termcolor-v0.2.2...anstyle-termcolor-v0.3.0 diff --git a/crates/anstyle-termcolor/Cargo.toml b/crates/anstyle-termcolor/Cargo.toml index fee593e6..21121c4d 100644 --- a/crates/anstyle-termcolor/Cargo.toml +++ b/crates/anstyle-termcolor/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-termcolor" -version = "1.1.0" +version = "1.1.3" description = "Adapt between termcolor and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "termcolor"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,7 +24,9 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } termcolor = "1.1.3" + +[lints] +workspace = true diff --git a/crates/anstyle-termcolor/README.md b/crates/anstyle-termcolor/README.md index 2f1b7404..682b7ae9 100644 --- a/crates/anstyle-termcolor/README.md +++ b/crates/anstyle-termcolor/README.md @@ -1,6 +1,6 @@ # anstyle-termcolor -> Convert from color styling types to [termcolor](https://lib.rs/termcolor) color types +> Convert between [termcolor](https://lib.rs/termcolor) and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-termcolor.svg) diff --git a/crates/anstyle-termcolor/src/lib.rs b/crates/anstyle-termcolor/src/lib.rs index d99a28c2..e6b8c4b9 100644 --- a/crates/anstyle-termcolor/src/lib.rs +++ b/crates/anstyle-termcolor/src/lib.rs @@ -1,19 +1,11 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn to_termcolor(self) -> termcolor::ColorSpec; -} +//! Convert between [termcolor](https://lib.rs/termcolor) and [generic styling types][anstyle] -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn to_termcolor(self) -> termcolor::ColorSpec { - to_termcolor_spec(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Adapt generic styling to [`termcolor`] pub fn to_termcolor_spec(style: anstyle::Style) -> termcolor::ColorSpec { let fg = style.get_fg_color().map(to_termcolor_color); let bg = style.get_bg_color().map(to_termcolor_color); @@ -29,6 +21,7 @@ pub fn to_termcolor_spec(style: anstyle::Style) -> termcolor::ColorSpec { style } +/// Adapt generic colors to [`termcolor`] pub fn to_termcolor_color(color: anstyle::Color) -> termcolor::Color { match color { anstyle::Color::Ansi(ansi) => ansi_to_termcolor_color(ansi), diff --git a/crates/anstyle-wincon/CHANGELOG.md b/crates/anstyle-wincon/CHANGELOG.md index 93ef66c2..ed0ee268 100644 --- a/crates/anstyle-wincon/CHANGELOG.md +++ b/crates/anstyle-wincon/CHANGELOG.md @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [3.0.6] - 2024-10-24 + +## [3.0.5] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +### Features + +- Implement AutoStream for dyn Write + auto traits + +## [3.0.4] - 2024-07-25 + +## [3.0.3] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [3.0.2] - 2023-12-04 + ## [3.0.1] - 2023-09-29 ### Features @@ -85,7 +107,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.0.1] - 2023-03-07 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.1...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.6...HEAD +[3.0.6]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.5...anstyle-wincon-v3.0.6 +[3.0.5]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.4...anstyle-wincon-v3.0.5 +[3.0.4]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.3...anstyle-wincon-v3.0.4 +[3.0.3]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.2...anstyle-wincon-v3.0.3 +[3.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.1...anstyle-wincon-v3.0.2 [3.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v3.0.0...anstyle-wincon-v3.0.1 [3.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v2.1.0...anstyle-wincon-v3.0.0 [2.1.0]: https://github.com/rust-cli/anstyle/compare/anstyle-wincon-v2.0.0...anstyle-wincon-v2.1.0 diff --git a/crates/anstyle-wincon/Cargo.toml b/crates/anstyle-wincon/Cargo.toml index 9488fbbd..58af4e2b 100644 --- a/crates/anstyle-wincon/Cargo.toml +++ b/crates/anstyle-wincon/Cargo.toml @@ -1,19 +1,19 @@ [package] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.6" description = "Styling legacy Windows terminals" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "windows"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true [package.metadata.docs.rs] +all-features = true rustdoc-args = ["--cfg", "docsrs"] -features = [] targets = ["x86_64-pc-windows-msvc"] [package.metadata.release] @@ -25,7 +25,6 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } @@ -33,4 +32,7 @@ anstyle = { version = "1.0.0", path = "../anstyle" } lexopt = "0.3.0" [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.48.0", features = ["Win32_System_Console", "Win32_Foundation"] } +windows-sys = { version = "0.59.0", features = ["Win32_System_Console", "Win32_Foundation"] } + +[lints] +workspace = true diff --git a/crates/anstyle-wincon/examples/dump.rs b/crates/anstyle-wincon/examples/dump-wincon.rs similarity index 85% rename from crates/anstyle-wincon/examples/dump.rs rename to crates/anstyle-wincon/examples/dump-wincon.rs index bb80bf42..fce11c69 100644 --- a/crates/anstyle-wincon/examples/dump.rs +++ b/crates/anstyle-wincon/examples/dump-wincon.rs @@ -1,3 +1,5 @@ +//! Write colored text using wincon API calls + use anstyle_wincon::WinconStream as _; fn main() -> Result<(), lexopt::Error> { @@ -13,32 +15,33 @@ fn main() -> Result<(), lexopt::Error> { } } - for r in 0..6 { - let _ = stdout.write_colored(None, None, &b"\n"[..]); - for g in 0..6 { - for b in 0..6 { - let fixed = r * 36 + g * 6 + b + 16; - let style = style(fixed, args.layer, args.effects); - let _ = print_number(&mut stdout, fixed, style); - } + for fixed in 16..232 { + let col = (fixed - 16) % 36; + if col == 0 { let _ = stdout.write_colored(None, None, &b"\n"[..]); } + let style = style(fixed, args.layer, args.effects); + let _ = print_number(&mut stdout, fixed, style); } - for c in 0..24 { - if 0 == c % 8 { - let _ = stdout.write_colored(None, None, &b"\n"[..]); - } - let fixed = 232 + c; + let _ = stdout.write_colored(None, None, &b"\n"[..]); + let _ = stdout.write_colored(None, None, &b"\n"[..]); + for fixed in 232..=255 { let style = style(fixed, args.layer, args.effects); let _ = print_number(&mut stdout, fixed, style); } + let _ = stdout.write_colored(None, None, &b"\n"[..]); + Ok(()) } -fn style(fixed: u8, layer: Layer, effects: anstyle::Effects) -> anstyle::Style { - let color = anstyle::Ansi256Color(fixed).into(); +fn style( + color: impl Into, + layer: Layer, + effects: anstyle::Effects, +) -> anstyle::Style { + let color = color.into(); (match layer { Layer::Fg => anstyle::Style::new().fg_color(Some(color)), Layer::Bg => anstyle::Style::new().bg_color(Some(color)), @@ -63,7 +66,7 @@ fn print_number( }); stdout - .write_colored(fg, bg, format!("{:>4}", fixed).as_bytes()) + .write_colored(fg, bg, format!("{fixed:>3X}").as_bytes()) .map(|_| ()) } diff --git a/crates/anstyle-wincon/examples/set.rs b/crates/anstyle-wincon/examples/set-wincon.rs similarity index 97% rename from crates/anstyle-wincon/examples/set.rs rename to crates/anstyle-wincon/examples/set-wincon.rs index 6febb0ae..6485a505 100644 --- a/crates/anstyle-wincon/examples/set.rs +++ b/crates/anstyle-wincon/examples/set-wincon.rs @@ -1,3 +1,5 @@ +//! Interactively manipulate wincon colors + #![cfg_attr(not(windows), allow(dead_code))] #[cfg(not(windows))] diff --git a/crates/anstyle-wincon/src/ansi.rs b/crates/anstyle-wincon/src/ansi.rs index 6ac71930..48c2c1e2 100644 --- a/crates/anstyle-wincon/src/ansi.rs +++ b/crates/anstyle-wincon/src/ansi.rs @@ -1,7 +1,7 @@ //! Low-level ANSI-styling /// Write ANSI colored text to the stream -pub fn write_colored( +pub fn write_colored( stream: &mut S, fg: Option, bg: Option, diff --git a/crates/anstyle-wincon/src/lib.rs b/crates/anstyle-wincon/src/lib.rs index e04fab6e..52327b14 100644 --- a/crates/anstyle-wincon/src/lib.rs +++ b/crates/anstyle-wincon/src/lib.rs @@ -9,6 +9,9 @@ //! - More focused, smaller #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] pub mod ansi; mod stream; diff --git a/crates/anstyle-wincon/src/stream.rs b/crates/anstyle-wincon/src/stream.rs index 9f101080..9692c7c2 100644 --- a/crates/anstyle-wincon/src/stream.rs +++ b/crates/anstyle-wincon/src/stream.rs @@ -9,18 +9,18 @@ pub trait WinconStream { ) -> std::io::Result; } -impl WinconStream for Box { +impl WinconStream for &mut T { fn write_colored( &mut self, fg: Option, bg: Option, data: &[u8], ) -> std::io::Result { - crate::ansi::write_colored(self, fg, bg, data) + (**self).write_colored(fg, bg, data) } } -impl WinconStream for &'_ mut Box { +impl WinconStream for Box { fn write_colored( &mut self, fg: Option, @@ -31,7 +31,7 @@ impl WinconStream for &'_ mut Box { } } -impl WinconStream for std::fs::File { +impl WinconStream for dyn std::io::Write { fn write_colored( &mut self, fg: Option, @@ -42,18 +42,18 @@ impl WinconStream for std::fs::File { } } -impl WinconStream for &'_ mut std::fs::File { +impl WinconStream for dyn std::io::Write + Send { fn write_colored( &mut self, fg: Option, bg: Option, data: &[u8], ) -> std::io::Result { - (**self).write_colored(fg, bg, data) + crate::ansi::write_colored(self, fg, bg, data) } } -impl WinconStream for Vec { +impl WinconStream for dyn std::io::Write + Send + Sync { fn write_colored( &mut self, fg: Option, @@ -64,14 +64,25 @@ impl WinconStream for Vec { } } -impl WinconStream for &'_ mut Vec { +impl WinconStream for std::fs::File { fn write_colored( &mut self, fg: Option, bg: Option, data: &[u8], ) -> std::io::Result { - (**self).write_colored(fg, bg, data) + crate::ansi::write_colored(self, fg, bg, data) + } +} + +impl WinconStream for Vec { + fn write_colored( + &mut self, + fg: Option, + bg: Option, + data: &[u8], + ) -> std::io::Result { + crate::ansi::write_colored(self, fg, bg, data) } } @@ -101,9 +112,7 @@ impl WinconStream for std::io::Stderr { #[cfg(not(windows))] mod platform { - use super::*; - - impl WinconStream for std::io::StdoutLock<'_> { + impl super::WinconStream for std::io::StdoutLock<'_> { fn write_colored( &mut self, fg: Option, @@ -114,7 +123,7 @@ mod platform { } } - impl WinconStream for std::io::StderrLock<'_> { + impl super::WinconStream for std::io::StderrLock<'_> { fn write_colored( &mut self, fg: Option, @@ -128,9 +137,7 @@ mod platform { #[cfg(windows)] mod platform { - use super::*; - - impl WinconStream for std::io::StdoutLock<'_> { + impl super::WinconStream for std::io::StdoutLock<'_> { fn write_colored( &mut self, fg: Option, @@ -142,7 +149,7 @@ mod platform { } } - impl WinconStream for std::io::StderrLock<'_> { + impl super::WinconStream for std::io::StderrLock<'_> { fn write_colored( &mut self, fg: Option, @@ -154,25 +161,3 @@ mod platform { } } } - -impl WinconStream for &'_ mut std::io::StdoutLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} - -impl WinconStream for &'_ mut std::io::StderrLock<'_> { - fn write_colored( - &mut self, - fg: Option, - bg: Option, - data: &[u8], - ) -> std::io::Result { - (**self).write_colored(fg, bg, data) - } -} diff --git a/crates/anstyle-wincon/src/windows.rs b/crates/anstyle-wincon/src/windows.rs index bf1cf565..d18e8ff4 100644 --- a/crates/anstyle-wincon/src/windows.rs +++ b/crates/anstyle-wincon/src/windows.rs @@ -86,6 +86,9 @@ pub(crate) fn write_colored( } mod inner { + use std::os::windows::io::RawHandle; + + use windows_sys::Win32::Foundation::HANDLE; use windows_sys::Win32::System::Console::CONSOLE_CHARACTER_ATTRIBUTES; use windows_sys::Win32::System::Console::CONSOLE_SCREEN_BUFFER_INFO; use windows_sys::Win32::System::Console::FOREGROUND_BLUE; @@ -93,8 +96,6 @@ mod inner { use windows_sys::Win32::System::Console::FOREGROUND_INTENSITY; use windows_sys::Win32::System::Console::FOREGROUND_RED; - use std::os::windows::io::RawHandle; - const FOREGROUND_CYAN: CONSOLE_CHARACTER_ATTRIBUTES = FOREGROUND_BLUE | FOREGROUND_GREEN; const FOREGROUND_MAGENTA: CONSOLE_CHARACTER_ATTRIBUTES = FOREGROUND_BLUE | FOREGROUND_RED; const FOREGROUND_YELLOW: CONSOLE_CHARACTER_ATTRIBUTES = FOREGROUND_GREEN | FOREGROUND_RED; @@ -128,8 +129,8 @@ mod inner { handle: RawHandle, ) -> Result { unsafe { - let handle = std::mem::transmute(handle); - if handle == 0 { + let handle: HANDLE = std::mem::transmute(handle); + if handle.is_null() { return Err(IoError::BrokenPipe); } @@ -149,8 +150,8 @@ mod inner { attributes: CONSOLE_CHARACTER_ATTRIBUTES, ) -> Result<(), IoError> { unsafe { - let handle = std::mem::transmute(handle); - if handle == 0 { + let handle: HANDLE = std::mem::transmute(handle); + if handle.is_null() { return Err(IoError::BrokenPipe); } diff --git a/crates/anstyle-yansi/CHANGELOG.md b/crates/anstyle-yansi/CHANGELOG.md index 685f8c14..2ba672b8 100644 --- a/crates/anstyle-yansi/CHANGELOG.md +++ b/crates/anstyle-yansi/CHANGELOG.md @@ -7,9 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [2.0.2] - 2024-10-24 + ### Compatibility -- Update MSRV to 1.70.0 +- Update MSRV to 1.66 + +## [2.0.1] - 2024-07-25 + +## [2.0.0] - 2024-06-23 + +- Update to yansi 1.0 + +## [1.0.1] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 ## [1.0.0] - 2023-04-13 @@ -32,7 +46,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2022-05-18 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v1.0.0...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v2.0.2...HEAD +[2.0.2]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v2.0.1...anstyle-yansi-v2.0.2 +[2.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v2.0.0...anstyle-yansi-v2.0.1 +[2.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v1.0.1...anstyle-yansi-v2.0.0 +[1.0.1]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v1.0.0...anstyle-yansi-v1.0.1 [1.0.0]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v0.3.0...anstyle-yansi-v1.0.0 [0.3.0]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v0.2.2...anstyle-yansi-v0.3.0 [0.2.2]: https://github.com/rust-cli/anstyle/compare/anstyle-yansi-v0.2.1...anstyle-yansi-v0.2.2 diff --git a/crates/anstyle-yansi/Cargo.toml b/crates/anstyle-yansi/Cargo.toml index 18b2703a..329c6f81 100644 --- a/crates/anstyle-yansi/Cargo.toml +++ b/crates/anstyle-yansi/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle-yansi" -version = "1.0.0" +version = "2.0.2" description = "Adapt between yansi and anstyle" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "yansi"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] pre-release-replacements = [ {file="CHANGELOG.md", search="Unreleased", replace="{{version}}", min=1}, @@ -20,7 +24,9 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/rust-cli/anstyle/compare/{{tag_name}}...HEAD", exactly=1}, ] - [dependencies] anstyle = { version = "1.0.0", path = "../anstyle" } -yansi = "0.5.1" +yansi = "1.0.0" + +[lints] +workspace = true diff --git a/crates/anstyle-yansi/README.md b/crates/anstyle-yansi/README.md index 436e38ff..b5cebea7 100644 --- a/crates/anstyle-yansi/README.md +++ b/crates/anstyle-yansi/README.md @@ -1,6 +1,6 @@ # anstyle-yansi -> Convert from color styling types to [yansi](https://lib.rs/yansi) color types +> Convert between [yansi](https://lib.rs/yansi) and generic styling types [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] ![License](https://img.shields.io/crates/l/anstyle-yansi.svg) diff --git a/crates/anstyle-yansi/src/lib.rs b/crates/anstyle-yansi/src/lib.rs index 814c0af5..31142e79 100644 --- a/crates/anstyle-yansi/src/lib.rs +++ b/crates/anstyle-yansi/src/lib.rs @@ -1,36 +1,28 @@ -mod sealed { - pub(crate) trait Sealed {} -} - -trait Ext: sealed::Sealed { - fn to_yansi(self) -> yansi::Style; -} +//! Convert between [yansi](https://lib.rs/yansi) and generic styling types -impl sealed::Sealed for anstyle::Style {} - -impl Ext for anstyle::Style { - fn to_yansi(self) -> yansi::Style { - to_yansi_style(self) - } -} +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] +/// Adapt generic styling to [`yansi`] pub fn to_yansi_style(style: anstyle::Style) -> yansi::Style { - let (fg, fg_bold) = style + let fg = style .get_fg_color() - .map(to_yansi_color_with_bold) - .unwrap_or((yansi::Color::Unset, false)); + .map(to_yansi_color) + .unwrap_or(yansi::Color::Primary); let bg = style .get_bg_color() .map(to_yansi_color) - .unwrap_or(yansi::Color::Unset); + .unwrap_or(yansi::Color::Primary); let effects = style.get_effects(); - let mut style = yansi::Style::new(fg).bg(bg); - if effects.contains(anstyle::Effects::BOLD) || fg_bold { + let mut style = yansi::Style::new().fg(fg).bg(bg); + if effects.contains(anstyle::Effects::BOLD) { style = style.bold(); } if effects.contains(anstyle::Effects::DIMMED) { - style = style.dimmed(); + style = style.dim(); } if effects.contains(anstyle::Effects::ITALIC) { style = style.italic(); @@ -45,44 +37,41 @@ pub fn to_yansi_style(style: anstyle::Style) -> yansi::Style { style = style.invert(); } if effects.contains(anstyle::Effects::HIDDEN) { - style = style.hidden(); + style = style.conceal(); } if effects.contains(anstyle::Effects::STRIKETHROUGH) { - style = style.strikethrough(); + style = style.strike(); } style } +/// Adapt generic color to [`yansi`] pub fn to_yansi_color(color: anstyle::Color) -> yansi::Color { - to_yansi_color_with_bold(color).0 -} - -fn to_yansi_color_with_bold(color: anstyle::Color) -> (yansi::Color, bool) { match color { anstyle::Color::Ansi(ansi) => ansi_to_yansi_color(ansi), - anstyle::Color::Ansi256(xterm) => (xterm_to_yansi_color(xterm), false), - anstyle::Color::Rgb(rgb) => (rgb_to_yansi_color(rgb), false), + anstyle::Color::Ansi256(xterm) => xterm_to_yansi_color(xterm), + anstyle::Color::Rgb(rgb) => rgb_to_yansi_color(rgb), } } -fn ansi_to_yansi_color(color: anstyle::AnsiColor) -> (yansi::Color, bool) { +fn ansi_to_yansi_color(color: anstyle::AnsiColor) -> yansi::Color { match color { - anstyle::AnsiColor::Black => (yansi::Color::Black, false), - anstyle::AnsiColor::Red => (yansi::Color::Red, false), - anstyle::AnsiColor::Green => (yansi::Color::Green, false), - anstyle::AnsiColor::Yellow => (yansi::Color::Yellow, false), - anstyle::AnsiColor::Blue => (yansi::Color::Blue, false), - anstyle::AnsiColor::Magenta => (yansi::Color::Magenta, false), - anstyle::AnsiColor::Cyan => (yansi::Color::Cyan, false), - anstyle::AnsiColor::White => (yansi::Color::White, false), - anstyle::AnsiColor::BrightBlack => (yansi::Color::Black, true), - anstyle::AnsiColor::BrightRed => (yansi::Color::Red, true), - anstyle::AnsiColor::BrightGreen => (yansi::Color::Green, true), - anstyle::AnsiColor::BrightYellow => (yansi::Color::Yellow, true), - anstyle::AnsiColor::BrightBlue => (yansi::Color::Black, true), - anstyle::AnsiColor::BrightMagenta => (yansi::Color::Magenta, true), - anstyle::AnsiColor::BrightCyan => (yansi::Color::Cyan, true), - anstyle::AnsiColor::BrightWhite => (yansi::Color::White, true), + anstyle::AnsiColor::Black => yansi::Color::Black, + anstyle::AnsiColor::Red => yansi::Color::Red, + anstyle::AnsiColor::Green => yansi::Color::Green, + anstyle::AnsiColor::Yellow => yansi::Color::Yellow, + anstyle::AnsiColor::Blue => yansi::Color::Blue, + anstyle::AnsiColor::Magenta => yansi::Color::Magenta, + anstyle::AnsiColor::Cyan => yansi::Color::Cyan, + anstyle::AnsiColor::White => yansi::Color::White, + anstyle::AnsiColor::BrightBlack => yansi::Color::BrightBlack, + anstyle::AnsiColor::BrightRed => yansi::Color::BrightRed, + anstyle::AnsiColor::BrightGreen => yansi::Color::BrightGreen, + anstyle::AnsiColor::BrightYellow => yansi::Color::BrightYellow, + anstyle::AnsiColor::BrightBlue => yansi::Color::BrightBlack, + anstyle::AnsiColor::BrightMagenta => yansi::Color::BrightMagenta, + anstyle::AnsiColor::BrightCyan => yansi::Color::BrightCyan, + anstyle::AnsiColor::BrightWhite => yansi::Color::BrightWhite, } } @@ -91,5 +80,5 @@ fn xterm_to_yansi_color(color: anstyle::Ansi256Color) -> yansi::Color { } fn rgb_to_yansi_color(color: anstyle::RgbColor) -> yansi::Color { - yansi::Color::RGB(color.0, color.1, color.2) + yansi::Color::Rgb(color.0, color.1, color.2) } diff --git a/crates/anstyle/CHANGELOG.md b/crates/anstyle/CHANGELOG.md index 610ddedb..8c09c7de 100644 --- a/crates/anstyle/CHANGELOG.md +++ b/crates/anstyle/CHANGELOG.md @@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +## [1.0.10] - 2024-11-01 + +### Performance + +- Replace some `write!`s with `write_str` + +## [1.0.9] - 2024-10-24 + +### Compatibility + +- Update MSRV to 1.66 + +## [1.0.8] - 2024-07-25 + +## [1.0.7] - 2024-05-02 + +### Fixes + +- Drop MSRV to 1.65 + +## [1.0.6] - 2024-02-05 + +### Fixes + +- Ignore `Display` settings like padding (we were inconsistent about that and generally wrong when we did it) + +## [1.0.5] - 2024-01-29 + +### Features + +- Implement `Display` for `Style` where the alternate flag is for reset +- Implement `Display` for `Reset` + ## [1.0.4] - 2023-09-28 ### Features @@ -149,7 +182,13 @@ MSRV updated to 1.64.0 ## [0.1.1] - 2022-05-18 -[Unreleased]: https://github.com/rust-cli/anstyle/compare/v1.0.4...HEAD +[Unreleased]: https://github.com/rust-cli/anstyle/compare/v1.0.10...HEAD +[1.0.10]: https://github.com/rust-cli/anstyle/compare/v1.0.9...v1.0.10 +[1.0.9]: https://github.com/rust-cli/anstyle/compare/v1.0.8...v1.0.9 +[1.0.8]: https://github.com/rust-cli/anstyle/compare/v1.0.7...v1.0.8 +[1.0.7]: https://github.com/rust-cli/anstyle/compare/v1.0.6...v1.0.7 +[1.0.6]: https://github.com/rust-cli/anstyle/compare/v1.0.5...v1.0.6 +[1.0.5]: https://github.com/rust-cli/anstyle/compare/v1.0.4...v1.0.5 [1.0.4]: https://github.com/rust-cli/anstyle/compare/v1.0.3...v1.0.4 [1.0.3]: https://github.com/rust-cli/anstyle/compare/v1.0.2...v1.0.3 [1.0.2]: https://github.com/rust-cli/anstyle/compare/v1.0.1...v1.0.2 diff --git a/crates/anstyle/Cargo.toml b/crates/anstyle/Cargo.toml index bcd18ae0..35b7e9d1 100644 --- a/crates/anstyle/Cargo.toml +++ b/crates/anstyle/Cargo.toml @@ -1,16 +1,20 @@ [package] name = "anstyle" -version = "1.0.4" +version = "1.0.10" description = "ANSI text styling" -repository = "https://github.com/rust-cli/anstyle.git" homepage = "https://github.com/rust-cli/anstyle" categories = ["command-line-interface"] keywords = ["ansi", "terminal", "color", "no_std"] +repository.workspace = true license.workspace = true edition.workspace = true rust-version.workspace = true include.workspace = true +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [package.metadata.release] tag-prefix = "" pre-release-replacements = [ @@ -29,3 +33,6 @@ std = [] [dev-dependencies] lexopt = "0.3.0" + +[lints] +workspace = true diff --git a/crates/anstyle/examples/dump.rs b/crates/anstyle/examples/dump-style.rs similarity index 79% rename from crates/anstyle/examples/dump.rs rename to crates/anstyle/examples/dump-style.rs index 1221cd6c..2e539eb6 100644 --- a/crates/anstyle/examples/dump.rs +++ b/crates/anstyle/examples/dump-style.rs @@ -1,3 +1,5 @@ +//! Write ANSI escape code colored text + use std::io::Write; fn main() -> Result<(), lexopt::Error> { @@ -6,39 +8,45 @@ fn main() -> Result<(), lexopt::Error> { let mut stdout = stdout.lock(); for fixed in 0..16 { - let style = style(fixed, args.layer, args.effects); + let color = anstyle::Ansi256Color(fixed) + .into_ansi() + .expect("4-bit range used"); + let style = style(color, args.layer, args.effects); let _ = print_number(&mut stdout, fixed, style); if fixed == 7 || fixed == 15 { let _ = writeln!(&mut stdout); } } - for r in 0..6 { - let _ = writeln!(stdout); - for g in 0..6 { - for b in 0..6 { - let fixed = r * 36 + g * 6 + b + 16; - let style = style(fixed, args.layer, args.effects); - let _ = print_number(&mut stdout, fixed, style); - } + for fixed in 16..232 { + let col = (fixed - 16) % 36; + if col == 0 { let _ = writeln!(stdout); } + let color = anstyle::Ansi256Color(fixed); + let style = style(color, args.layer, args.effects); + let _ = print_number(&mut stdout, fixed, style); } - for c in 0..24 { - if 0 == c % 8 { - let _ = writeln!(stdout); - } - let fixed = 232 + c; - let style = style(fixed, args.layer, args.effects); + let _ = writeln!(stdout); + let _ = writeln!(stdout); + for fixed in 232..=255 { + let color = anstyle::Ansi256Color(fixed); + let style = style(color, args.layer, args.effects); let _ = print_number(&mut stdout, fixed, style); } + let _ = writeln!(stdout); + Ok(()) } -fn style(fixed: u8, layer: Layer, effects: anstyle::Effects) -> anstyle::Style { - let color = anstyle::Ansi256Color(fixed).into(); +fn style( + color: impl Into, + layer: Layer, + effects: anstyle::Effects, +) -> anstyle::Style { + let color = color.into(); (match layer { Layer::Fg => anstyle::Style::new().fg_color(Some(color)), Layer::Bg => anstyle::Style::new().bg_color(Some(color)), @@ -51,13 +59,7 @@ fn print_number( fixed: u8, style: anstyle::Style, ) -> std::io::Result<()> { - write!( - stdout, - "{}{:>4}{}", - style.render(), - fixed, - anstyle::Reset.render() - ) + write!(stdout, "{style}{fixed:>3X}{style:#}",) } #[derive(Default)] diff --git a/crates/anstyle/src/color.rs b/crates/anstyle/src/color.rs index 8dcf6ca5..b930a020 100644 --- a/crates/anstyle/src/color.rs +++ b/crates/anstyle/src/color.rs @@ -1,8 +1,18 @@ /// Any ANSI color code scheme +#[allow(clippy::exhaustive_enums)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Color { + /// Available 4-bit ANSI color palette codes + /// + /// The user's terminal defines the meaning of the each palette code. Ansi(AnsiColor), + /// 256 (8-bit) color support + /// + /// - `0..16` are [`AnsiColor`] palette codes + /// - `0..232` map to [`RgbColor`] color values + /// - `232..` map to [`RgbColor`] gray-scale values Ansi256(Ansi256Color), + /// 24-bit ANSI RGB color codes Rgb(RgbColor), } @@ -23,9 +33,9 @@ impl Color { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_fg(self) -> impl core::fmt::Display + Copy { match self { - Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_fg_str()), + Self::Ansi(color) => color.as_fg_buffer(), Self::Ansi256(color) => color.as_fg_buffer(), Self::Rgb(color) => color.as_fg_buffer(), } @@ -35,7 +45,7 @@ impl Color { #[cfg(feature = "std")] pub(crate) fn write_fg_to(self, write: &mut dyn std::io::Write) -> std::io::Result<()> { let buffer = match self { - Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_fg_str()), + Self::Ansi(color) => color.as_fg_buffer(), Self::Ansi256(color) => color.as_fg_buffer(), Self::Rgb(color) => color.as_fg_buffer(), }; @@ -44,9 +54,9 @@ impl Color { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_bg(self) -> impl core::fmt::Display + Copy { match self { - Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_bg_str()), + Self::Ansi(color) => color.as_bg_buffer(), Self::Ansi256(color) => color.as_bg_buffer(), Self::Rgb(color) => color.as_bg_buffer(), } @@ -56,7 +66,7 @@ impl Color { #[cfg(feature = "std")] pub(crate) fn write_bg_to(self, write: &mut dyn std::io::Write) -> std::io::Result<()> { let buffer = match self { - Self::Ansi(color) => DisplayBuffer::default().write_str(color.as_bg_str()), + Self::Ansi(color) => color.as_bg_buffer(), Self::Ansi256(color) => color.as_bg_buffer(), Self::Rgb(color) => color.as_bg_buffer(), }; @@ -64,7 +74,7 @@ impl Color { } #[inline] - pub(crate) fn render_underline(self) -> impl core::fmt::Display + Copy + Clone { + pub(crate) fn render_underline(self) -> impl core::fmt::Display + Copy { match self { Self::Ansi(color) => color.as_underline_buffer(), Self::Ansi256(color) => color.as_underline_buffer(), @@ -122,6 +132,7 @@ impl From<(u8, u8, u8)> for Color { /// Available 4-bit ANSI color palette codes /// /// The user's terminal defines the meaning of the each palette code. +#[allow(clippy::exhaustive_enums)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(u8)] pub enum AnsiColor { @@ -191,8 +202,8 @@ impl AnsiColor { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { - self.as_fg_str() + pub fn render_fg(self) -> impl core::fmt::Display + Copy { + NullFormatter(self.as_fg_str()) } #[inline] @@ -217,10 +228,15 @@ impl AnsiColor { } } + #[inline] + fn as_fg_buffer(&self) -> DisplayBuffer { + DisplayBuffer::default().write_str(self.as_fg_str()) + } + /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { - self.as_bg_str() + pub fn render_bg(self) -> impl core::fmt::Display + Copy { + NullFormatter(self.as_bg_str()) } #[inline] @@ -245,6 +261,11 @@ impl AnsiColor { } } + #[inline] + fn as_bg_buffer(&self) -> DisplayBuffer { + DisplayBuffer::default().write_str(self.as_bg_str()) + } + #[inline] fn as_underline_buffer(&self) -> DisplayBuffer { // No per-color codes; must delegate to `Ansi256Color` @@ -325,6 +346,7 @@ impl AnsiColor { /// - `0..16` are [`AnsiColor`] palette codes /// - `0..232` map to [`RgbColor`] color values /// - `232..` map to [`RgbColor`] gray-scale values +#[allow(clippy::exhaustive_structs)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] pub struct Ansi256Color(pub u8); @@ -344,11 +366,13 @@ impl Ansi256Color { crate::Style::new().fg_color(Some(Color::Ansi256(self))) } + /// Get the raw value #[inline] pub const fn index(self) -> u8 { self.0 } + /// Convert to [`AnsiColor`] when there is a 1:1 mapping #[inline] pub const fn into_ansi(self) -> Option { match self.index() { @@ -372,6 +396,7 @@ impl Ansi256Color { } } + /// Losslessly convert from [`AnsiColor`] #[inline] pub const fn from_ansi(color: AnsiColor) -> Self { match color { @@ -396,7 +421,7 @@ impl Ansi256Color { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_fg(self) -> impl core::fmt::Display + Copy { self.as_fg_buffer() } @@ -410,7 +435,7 @@ impl Ansi256Color { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_bg(self) -> impl core::fmt::Display + Copy { self.as_bg_buffer() } @@ -446,6 +471,7 @@ impl From for Ansi256Color { } /// 24-bit ANSI RGB color codes +#[allow(clippy::exhaustive_structs)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RgbColor(pub u8, pub u8, pub u8); @@ -464,16 +490,19 @@ impl RgbColor { crate::Style::new().fg_color(Some(Color::Rgb(self))) } + /// Red #[inline] pub const fn r(self) -> u8 { self.0 } + /// Green #[inline] pub const fn g(self) -> u8 { self.1 } + /// Blue #[inline] pub const fn b(self) -> u8 { self.2 @@ -481,7 +510,7 @@ impl RgbColor { /// Render the ANSI code for a foreground color #[inline] - pub fn render_fg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_fg(self) -> impl core::fmt::Display + Copy { self.as_fg_buffer() } @@ -499,7 +528,7 @@ impl RgbColor { /// Render the ANSI code for a background color #[inline] - pub fn render_bg(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_bg(self) -> impl core::fmt::Display + Copy { self.as_bg_buffer() } @@ -536,9 +565,11 @@ impl From<(u8, u8, u8)> for RgbColor { } } +const DISPLAY_BUFFER_CAPACITY: usize = 19; + #[derive(Copy, Clone, Default, Debug)] struct DisplayBuffer { - buffer: [u8; 19], + buffer: [u8; DISPLAY_BUFFER_CAPACITY], len: usize, } @@ -580,7 +611,10 @@ impl DisplayBuffer { #[inline] fn as_str(&self) -> &str { // SAFETY: Only `&str` can be written to the buffer - unsafe { core::str::from_utf8_unchecked(&self.buffer[0..self.len]) } + #[allow(unsafe_code)] + unsafe { + core::str::from_utf8_unchecked(&self.buffer[0..self.len]) + } } #[inline] @@ -593,7 +627,17 @@ impl DisplayBuffer { impl core::fmt::Display for DisplayBuffer { #[inline] fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) + } +} + +#[derive(Copy, Clone, Default, Debug)] +struct NullFormatter(&'static str); + +impl core::fmt::Display for NullFormatter { + #[inline] + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.write_str(self.0) } } @@ -607,5 +651,35 @@ mod test { let c = RgbColor(255, 255, 255); let actual = c.render_fg().to_string(); assert_eq!(actual, "\u{1b}[38;2;255;255;255m"); + assert_eq!(actual.len(), DISPLAY_BUFFER_CAPACITY); + } + + #[test] + fn print_size_of() { + use std::mem::size_of; + dbg!(size_of::()); + dbg!(size_of::()); + dbg!(size_of::()); + dbg!(size_of::()); + dbg!(size_of::()); + } + + #[test] + fn no_align() { + #[track_caller] + fn assert_no_align(d: impl core::fmt::Display) { + let expected = format!("{d}"); + let actual = format!("{d:<10}"); + assert_eq!(expected, actual); + } + + assert_no_align(AnsiColor::White.render_fg()); + assert_no_align(AnsiColor::White.render_bg()); + assert_no_align(Ansi256Color(0).render_fg()); + assert_no_align(Ansi256Color(0).render_bg()); + assert_no_align(RgbColor(0, 0, 0).render_fg()); + assert_no_align(RgbColor(0, 0, 0).render_bg()); + assert_no_align(Color::Ansi(AnsiColor::White).render_fg()); + assert_no_align(Color::Ansi(AnsiColor::White).render_bg()); } } diff --git a/crates/anstyle/src/effect.rs b/crates/anstyle/src/effect.rs index 56b3e615..507dfc83 100644 --- a/crates/anstyle/src/effect.rs +++ b/crates/anstyle/src/effect.rs @@ -9,21 +9,30 @@ pub struct Effects(u16); impl Effects { + /// No [`Effects`] applied const PLAIN: Self = Effects(0); + #[allow(missing_docs)] pub const BOLD: Self = Effects(1 << 0); + #[allow(missing_docs)] pub const DIMMED: Self = Effects(1 << 1); /// Not widely supported. Sometimes treated as inverse or blink pub const ITALIC: Self = Effects(1 << 2); /// Style extensions exist for Kitty, VTE, mintty and iTerm2. pub const UNDERLINE: Self = Effects(1 << 3); + #[allow(missing_docs)] pub const DOUBLE_UNDERLINE: Self = Effects(1 << 4); + #[allow(missing_docs)] pub const CURLY_UNDERLINE: Self = Effects(1 << 5); + #[allow(missing_docs)] pub const DOTTED_UNDERLINE: Self = Effects(1 << 6); + #[allow(missing_docs)] pub const DASHED_UNDERLINE: Self = Effects(1 << 7); + #[allow(missing_docs)] pub const BLINK: Self = Effects(1 << 8); /// Swap foreground and background colors; inconsistent emulation pub const INVERT: Self = Effects(1 << 9); + #[allow(missing_docs)] pub const HIDDEN: Self = Effects(1 << 10); /// Characters legible but marked as if for deletion. Not supported in Terminal.app pub const STRIKETHROUGH: Self = Effects(1 << 11); @@ -156,7 +165,7 @@ impl Effects { /// Render the ANSI code #[inline] - pub fn render(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render(self) -> impl core::fmt::Display + Copy { EffectsDisplay(self) } @@ -314,12 +323,13 @@ impl core::fmt::Display for EffectsDisplay { #[inline] fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { for index in self.0.index_iter() { - METADATA[index].escape.fmt(f)?; + f.write_str(METADATA[index].escape)?; } Ok(()) } } +/// Enumerate each enabled value in [`Effects`] #[derive(Clone, Debug, PartialEq, Eq)] pub struct EffectIter { index: usize, @@ -367,3 +377,28 @@ impl Iterator for EffectIndexIter { None } } + +#[cfg(test)] +#[cfg(feature = "std")] +mod test { + use super::*; + + #[test] + fn print_size_of() { + use std::mem::size_of; + dbg!(size_of::()); + dbg!(size_of::()); + } + + #[test] + fn no_align() { + #[track_caller] + fn assert_no_align(d: impl core::fmt::Display) { + let expected = format!("{d}"); + let actual = format!("{d:<10}"); + assert_eq!(expected, actual); + } + + assert_no_align(Effects::BOLD.render()); + } +} diff --git a/crates/anstyle/src/lib.rs b/crates/anstyle/src/lib.rs index 41b7174e..3ce6a842 100644 --- a/crates/anstyle/src/lib.rs +++ b/crates/anstyle/src/lib.rs @@ -25,11 +25,12 @@ //! //! User-styling parsers: //! - [anstyle-git](https://docs.rs/anstyle-git): Parse Git style descriptions -//! - [anstyle-ls](https://docs.rs/anstyle-ls): Parse LS_COLORS style descriptions +//! - [anstyle-ls](https://docs.rs/anstyle-ls): Parse `LS_COLORS` style descriptions //! //! Convert to other formats //! - [anstream](https://docs.rs/anstream): A simple cross platform library for writing colored text to a terminal //! - [anstyle-roff](https://docs.rs/anstyle-roff): For converting to ROFF +//! - [anstyle-syntect](https://docs.rs/anstyle-syntect): For working with syntax highlighting //! //! Utilities //! - [anstyle-lossy](https://docs.rs/anstyle-lossy): Convert between `anstyle::Color` types @@ -44,6 +45,10 @@ //! ``` #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![warn(missing_docs)] +#![warn(clippy::print_stderr)] +#![warn(clippy::print_stdout)] #[macro_use] mod macros; diff --git a/crates/anstyle/src/reset.rs b/crates/anstyle/src/reset.rs index c8c21409..5a4a5f75 100644 --- a/crates/anstyle/src/reset.rs +++ b/crates/anstyle/src/reset.rs @@ -1,22 +1,47 @@ /// Reset terminal formatting +#[allow(clippy::exhaustive_structs)] #[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Reset; impl Reset { /// Render the ANSI code + /// + /// `Reset` also implements `Display` directly, so calling this method is optional. #[inline] - pub fn render(self) -> impl core::fmt::Display + Copy + Clone { - ResetDisplay + pub fn render(self) -> impl core::fmt::Display + Copy { + self } } -#[derive(Copy, Clone, Default, Debug)] -struct ResetDisplay; - -impl core::fmt::Display for ResetDisplay { +impl core::fmt::Display for Reset { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - RESET.fmt(f) + f.write_str(RESET) } } pub(crate) const RESET: &str = "\x1B[0m"; + +#[cfg(test)] +#[cfg(feature = "std")] +mod test { + use super::*; + + #[test] + fn print_size_of() { + use std::mem::size_of; + dbg!(size_of::()); + } + + #[test] + fn no_align() { + #[track_caller] + fn assert_no_align(d: impl core::fmt::Display) { + let expected = format!("{d}"); + let actual = format!("{d:<10}"); + assert_eq!(expected, actual); + } + + assert_no_align(Reset); + assert_no_align(Reset.render()); + } +} diff --git a/crates/anstyle/src/style.rs b/crates/anstyle/src/style.rs index f4da242b..cfa80858 100644 --- a/crates/anstyle/src/style.rs +++ b/crates/anstyle/src/style.rs @@ -2,10 +2,17 @@ use crate::reset::RESET; /// ANSI Text styling /// +/// You can print a `Style` to render the corresponding ANSI code. +/// Using the alternate flag `#` will render the ANSI reset code, if needed. +/// Together, this makes it convenient to render styles using inline format arguments. +/// /// # Examples /// /// ```rust /// let style = anstyle::Style::new().bold(); +/// +/// let value = 42; +/// println!("{style}{value}{style:#}"); /// ``` #[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Style { @@ -91,11 +98,33 @@ impl Style { } /// Render the ANSI code + /// + /// `Style` also implements `Display` directly, so calling this method is optional. #[inline] - pub fn render(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render(self) -> impl core::fmt::Display + Copy { StyleDisplay(self) } + fn fmt_to(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + use core::fmt::Display as _; + + self.effects.render().fmt(f)?; + + if let Some(fg) = self.fg { + fg.render_fg().fmt(f)?; + } + + if let Some(bg) = self.bg { + bg.render_bg().fmt(f)?; + } + + if let Some(underline) = self.underline { + underline.render_underline().fmt(f)?; + } + + Ok(()) + } + /// Write the ANSI code #[inline] #[cfg(feature = "std")] @@ -121,7 +150,7 @@ impl Style { /// /// Unlike [`Reset::render`][crate::Reset::render], this will elide the code if there is nothing to reset. #[inline] - pub fn render_reset(self) -> impl core::fmt::Display + Copy + Clone { + pub fn render_reset(self) -> impl core::fmt::Display + Copy { if self != Self::new() { RESET } else { @@ -260,27 +289,32 @@ impl Style { /// # Reflection impl Style { + /// Get the foreground color #[inline] pub const fn get_fg_color(self) -> Option { self.fg } + /// Get the background color #[inline] + #[allow(missing_docs)] pub const fn get_bg_color(self) -> Option { self.bg } #[inline] + #[allow(missing_docs)] pub const fn get_underline_color(self) -> Option { self.underline } #[inline] + #[allow(missing_docs)] pub const fn get_effects(self) -> crate::Effects { self.effects } - /// Check if no effects are enabled + /// Check if no styling is enabled #[inline] pub const fn is_plain(self) -> bool { self.fg.is_none() @@ -366,7 +400,7 @@ impl core::ops::SubAssign for Style { /// assert_ne!(anstyle::Effects::UNDERLINE | effects, effects); /// assert_ne!(anstyle::RgbColor(0, 0, 0).on_default() | effects, effects); /// ``` -impl core::cmp::PartialEq for Style { +impl PartialEq for Style { #[inline] fn eq(&self, other: &crate::Effects) -> bool { let other = Self::from(*other); @@ -374,25 +408,30 @@ impl core::cmp::PartialEq for Style { } } +impl core::fmt::Display for Style { + #[inline] + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + if f.alternate() { + self.render_reset().fmt(f) + } else { + self.fmt_to(f) + } + } +} + #[derive(Copy, Clone, Default, Debug)] struct StyleDisplay(Style); impl core::fmt::Display for StyleDisplay { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - self.0.effects.render().fmt(f)?; - - if let Some(fg) = self.0.fg { - fg.render_fg().fmt(f)?; - } - - if let Some(bg) = self.0.bg { - bg.render_bg().fmt(f)?; - } - - if let Some(underline) = self.0.underline { - underline.render_underline().fmt(f)?; - } - - Ok(()) + self.0.fmt_to(f) } } + +#[test] +#[cfg(feature = "std")] +fn print_size_of() { + use std::mem::size_of; + dbg!(size_of::