diff --git a/.github/install-clang-action/action.yml b/.github/install-clang-action/action.yml index 8ac79331..8c05ba17 100644 --- a/.github/install-clang-action/action.yml +++ b/.github/install-clang-action/action.yml @@ -33,6 +33,7 @@ runs: shell: bash continue-on-error: true run: | + brew update brew install llvm@${{ inputs.version }} ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-format" "/usr/local/bin/clang-format-${{ inputs.version }}" ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-tidy" "/usr/local/bin/clang-tidy-${{ inputs.version }}" diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index fbec12fc..635bf217 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -24,6 +24,12 @@ on: # performance analysis in order to generate initial data. workflow_dispatch: +# This CI workflow can take up to 2 hours. +# This setting will auto-cancel a old run if a new run is started. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: benchmark: runs-on: ubuntu-latest diff --git a/.github/workflows/pre-commit-hooks.yml b/.github/workflows/pre-commit-hooks.yml index 7cb35476..43a82c91 100644 --- a/.github/workflows/pre-commit-hooks.yml +++ b/.github/workflows/pre-commit-hooks.yml @@ -26,7 +26,7 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - name: cargo clippy - run: cargo clippy + run: cargo clippy -- -D warnings - name: cargo fmt run: cargo fmt --check diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml index 3454a351..88ef76e0 100644 --- a/.github/workflows/run-dev-tests.yml +++ b/.github/workflows/run-dev-tests.yml @@ -52,9 +52,6 @@ jobs: with: tool: cargo-nextest,cargo-llvm-cov,cargo-binstall - - name: Install llvm-cov-pretty (HTML report generator) - run: cargo binstall -y llvm-cov-pretty - - uses: actions/setup-python@v5 with: python-version: 3.x @@ -84,18 +81,6 @@ jobs: - if: runner.os == 'Linux' run: sudo apt-get update - - name: Install clang v8 - if: runner.os == 'Linux' - uses: ./.github/install-clang-action - with: - version: '8' - - - name: Collect Coverage for clang v8 - if: runner.os == 'Linux' - env: - CLANG_VERSION: '8' - run: uvx nox -s test -- --profile ci - - name: Install clang v9 uses: ./.github/install-clang-action with: @@ -194,21 +179,55 @@ jobs: - name: Collect Coverage for clang v18 env: CLANG_VERSION: '18' + run: uvx nox -s test -- --profile ci + + - name: Install clang v19 + if: runner.os == 'Linux' + uses: ./.github/install-clang-action + with: + version: '19' + + - name: Collect Coverage for clang v19 + if: runner.os == 'Linux' + env: + CLANG_VERSION: '19' + run: uvx nox -s test -- --profile ci + + - name: Install clang v20 + if: runner.os == 'Linux' + uses: ./.github/install-clang-action + with: + version: '20' + + - name: Collect Coverage for clang v20 + if: runner.os == 'Linux' + env: + CLANG_VERSION: '20' + run: uvx nox -s test -- --profile ci + + - name: Install clang v21 + if: runner.os == 'Linux' + uses: ./.github/install-clang-action + with: + version: '21' + + - name: Collect Coverage for clang v21 + if: runner.os == 'Linux' + env: + CLANG_VERSION: '21' run: uvx nox -s test -- --profile all - name: Generate Coverage HTML report - run: uvx nox -s pretty-cov + run: uvx nox -s llvm-cov - name: Upload coverage data uses: actions/upload-artifact@v4 with: name: HTML_report-${{ runner.os }} - path: target/llvm-cov-pretty + path: target/llvm-cov/html - name: Generate Coverage lcov report - run: | - rm coverage.json - uvx nox -s lcov + run: uvx nox -s lcov - uses: codecov/codecov-action@v5 with: diff --git a/Cargo.lock b/Cargo.lock index 03dd2fc0..3ce984d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,18 +260,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.45" +version = "4.5.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318" +checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.44" +version = "4.5.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8" +checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41" dependencies = [ "anstream", "anstyle", @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "fast-glob" -version = "0.4.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ea3f6bbcf4dbe2076b372186fc7aeecd5f6f84754582e56ee7db262b15a6f0" +checksum = "3d26eec0ae9682c457cb0f85de67ad417b716ae852736a5d94c2ad6e92a997c9" dependencies = [ "arrayvec", ] @@ -1633,9 +1633,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" +checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383" dependencies = [ "indoc", "libc", @@ -1650,19 +1650,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" +checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f" dependencies = [ - "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" +checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105" dependencies = [ "libc", "pyo3-build-config", @@ -1670,9 +1669,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" +checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1682,9 +1681,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" +checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf" dependencies = [ "heck", "proc-macro2", @@ -1695,9 +1694,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9845d9dccf565065824e69f9f235fafba1587031eda353c1f1561cd6a6be78f4" +checksum = "42a232e7487fc2ef313d96dde7948e7a3c05101870d8985e4fd8d26aedd27b89" dependencies = [ "memchr", "serde", @@ -1778,9 +1777,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -2148,15 +2147,15 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.20.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 4a42d664..d69acd03 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -17,7 +17,7 @@ crate-type = ["cdylib"] bench = false [dependencies] -pyo3 = { version = "0.25.1", features = ["extension-module"] } +pyo3 = { version = "0.26.0", features = ["extension-module"] } cpp-linter = { path = "../../cpp-linter" } tokio = "1.47.1" diff --git a/cpp-linter/Cargo.toml b/cpp-linter/Cargo.toml index 2704ca42..de2eac2d 100644 --- a/cpp-linter/Cargo.toml +++ b/cpp-linter/Cargo.toml @@ -16,17 +16,17 @@ license.workspace = true [dependencies] anyhow = "1.0.99" chrono = "0.4.41" -clap = "4.5.45" +clap = "4.5.46" colored = "3.0.0" -fast-glob = "0.4.5" +fast-glob = "1.0.0" futures = "0.3.31" git2 = "0.20.2" lenient_semver = "0.4.2" log = { version = "0.4.27", features = ["std"] } openssl = { version = "0.10", features = ["vendored"], optional = true } openssl-probe = { version = "0.1", optional = true } -quick-xml = {version = "0.38.1", features = ["serialize"]} -regex = "1.11.1" +quick-xml = {version = "0.38.3", features = ["serialize"]} +regex = "1.11.2" reqwest = "0.12.23" semver = "1.0.26" serde = { version = "1.0.219", features = ["derive"] } @@ -39,7 +39,7 @@ which = "8.0.0" [dev-dependencies] criterion = { version = "3.0.5", package = "codspeed-criterion-compat", features=["async_tokio"] } mockito = "1.7.0" -tempfile = "3.20.0" +tempfile = "3.21.0" [features] openssl-vendored = ["dep:openssl", "dep:openssl-probe"] diff --git a/cpp-linter/src/clang_tools/mod.rs b/cpp-linter/src/clang_tools/mod.rs index f89078ec..bc985863 100644 --- a/cpp-linter/src/clang_tools/mod.rs +++ b/cpp-linter/src/clang_tools/mod.rs @@ -65,9 +65,9 @@ pub fn get_clang_tool_exe(name: &str, version: &str) -> Result { // On Unix systems, this block is not likely reached. Typically, installing clang // will produce a symlink to the executable with the major version appended to the // name. - return Ok(cmd); + Ok(cmd) } else { - return Err(anyhow!("Could not find clang tool by name and version")); + Err(anyhow!("Could not find clang tool by name and version")) } } else { // `version` specified is not a semantic version; treat as path/to/bin diff --git a/cpp-linter/src/git.rs b/cpp-linter/src/git.rs index e777f23c..8d2d93f3 100644 --- a/cpp-linter/src/git.rs +++ b/cpp-linter/src/git.rs @@ -49,7 +49,7 @@ fn get_sha(repo: &Repository, depth: Option) -> Result, Er /// If there are files staged for a commit, then the resulting [`Diff`] will describe /// the staged changes. However, if there are no staged changes, then the last commit's /// [`Diff`] is returned. -pub fn get_diff(repo: &Repository) -> Result { +pub fn get_diff(repo: &'_ Repository) -> Result> { let head = get_sha(repo, None).unwrap().peel_to_tree().unwrap(); let mut has_staged_files = false; for entry in repo.statuses(None).unwrap().iter() { diff --git a/docs/Cargo.toml b/docs/Cargo.toml index 90218882..83a6fa45 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -10,7 +10,7 @@ license.workspace = true [dependencies] cpp-linter = { path = "../cpp-linter" } -pyo3 = "0.25.1" +pyo3 = "0.26.0" [lib] name = "cli_gen"