From 94140f21e9d8c4a9462c53f6ce3d1630f8e357e4 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Thu, 5 Feb 2026 10:45:42 +0200 Subject: [PATCH 1/2] clippy: swithc to rules_lint Clippy is invoked by using rules_lint Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- .bazelrc | 7 ++++ .github/workflows/lint_clippy.yml | 53 +++++++------------------------ MODULE.bazel | 4 +-- README.md | 9 ++++++ 4 files changed, 29 insertions(+), 44 deletions(-) diff --git a/.bazelrc b/.bazelrc index e2dc4ae9..dab6c8b6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -16,5 +16,12 @@ build:arm64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene: common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu + +# Clippy linting (enabled by default) +build --aspects=@score_rust_policies//clippy:linters.bzl%clippy_strict +build --output_groups=+rules_lint_human +build:lint --@aspect_rules_lint//lint:fail_on_violation=true + + # Deprecated configurations build:build_qnx8 --config=arm64-qnx diff --git a/.github/workflows/lint_clippy.yml b/.github/workflows/lint_clippy.yml index 912de334..06cec9d3 100644 --- a/.github/workflows/lint_clippy.yml +++ b/.github/workflows/lint_clippy.yml @@ -11,51 +11,20 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -name: clippy check +name: Bazel Clippy on: pull_request: - branches: [main, development] - types: [opened, ready_for_review, reopened, synchronize] + types: [opened, reopened, synchronize] + push: + branches: + - main + merge_group: + types: [checks_requested] -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: lint-clippy: - timeout-minutes: 6 # 6 minutes is the maximum allowed for a cold run - runs-on: ${{ vars.REPO_RUNNER_LABELS && fromJSON(vars.REPO_RUNNER_LABELS) || 'ubuntu-latest' }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install protoc 26.1 - uses: arduino/setup-protoc@v3 - with: - version: 26.1 - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Cache Cargo registry, git deps & target - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-lint-clippy-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-lint-clippy- - - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.90.0 - override: true - components: clippy - - - name: check clippy errors - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features --all-targets --workspace -- -D warnings + uses: eclipse-score/cicd-workflows/.github/workflows/static-analysis.yml@main + with: + bazel-targets: "//src/..." + bazel-config: "lint" diff --git a/MODULE.bazel b/MODULE.bazel index f689f422..68dd2cd8 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,7 +21,7 @@ bazel_dep(name = "rules_python", version = "1.4.1") bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_rust", version = "0.61.0") bazel_dep(name = "rules_cc", version = "0.1.1") -bazel_dep(name = "aspect_rules_lint", version = "1.0.3") +bazel_dep(name = "aspect_rules_lint", version = "2.0.0") bazel_dep(name = "buildifier_prebuilt", version = "7.3.1") bazel_dep(name = "platforms", version = "1.0.0") @@ -29,7 +29,7 @@ bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "score_bazel_platforms", version = "0.0.4") bazel_dep(name = "score_docs_as_code", version = "2.0.2") bazel_dep(name = "score_tooling", version = "1.1.0") -bazel_dep(name = "score_rust_policies", version = "0.0.3") +bazel_dep(name = "score_rust_policies", version = "0.0.4") bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True) bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) # This is main score repo diff --git a/README.md b/README.md index 324ab079..f46cd071 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,15 @@ bazel test //tests/... --- +## Clippy + +- Clippy runs by default via `.bazelrc` when building Rust targets (rules_lint aspect). +- Use `bazel build //src/...` (or any Rust target pattern) while developing. +- Use `bazel build --config=lint //src/...` to enable lint config, including `--@aspect_rules_lint//lint:fail_on_violation=true`. +- The Clippy config comes from `@score_rust_policies//clippy/strict:clippy.toml`. + +--- + ## 🛠 Tools & Linters **Tools and linters** from **centralized repositories** are integrated to ensure consistency across projects. From 58b00dca70c299e1935a9bbd606b60a465529b50 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Thu, 5 Feb 2026 15:15:10 +0200 Subject: [PATCH 2/2] msrv: updated msrv to 1.90.0 update msrv to 1.90.0 Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 68dd2cd8..3f89e4ae 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -29,7 +29,7 @@ bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "score_bazel_platforms", version = "0.0.4") bazel_dep(name = "score_docs_as_code", version = "2.0.2") bazel_dep(name = "score_tooling", version = "1.1.0") -bazel_dep(name = "score_rust_policies", version = "0.0.4") +bazel_dep(name = "score_rust_policies", version = "0.0.5") bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True) bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True) # This is main score repo