Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/install-clang-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
59 changes: 39 additions & 20 deletions .github/workflows/run-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
47 changes: 23 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 5 additions & 5 deletions cpp-linter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand All @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions cpp-linter/src/clang_tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ pub fn get_clang_tool_exe(name: &str, version: &str) -> Result<PathBuf> {
// 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
Expand Down
2 changes: 1 addition & 1 deletion cpp-linter/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn get_sha(repo: &Repository, depth: Option<u32>) -> Result<git2::Object<'_>, 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<git2::Diff> {
pub fn get_diff(repo: &'_ Repository) -> Result<git2::Diff<'_>> {
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() {
Expand Down
2 changes: 1 addition & 1 deletion docs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading