From e40b6ed48f3311f5bd480507b416cc98c1c8c883 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Wed, 4 Feb 2026 17:51:10 +0200 Subject: [PATCH 1/2] clippy: integrated clippy using rules_lint added new workflow, integrated clippy using rules_lint Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- .bazelrc | 7 +++++ .github/workflows/clippy.yml | 28 +++++++++++++++++++ .../{lint_fmt_clippy.yml => lint_fmt.yml} | 8 +----- MODULE.bazel | 5 +++- README.md | 7 +++++ 5 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/clippy.yml rename .github/workflows/{lint_fmt_clippy.yml => lint_fmt.yml} (90%) diff --git a/.bazelrc b/.bazelrc index 6683d3e..78a37de 100644 --- a/.bazelrc +++ b/.bazelrc @@ -17,3 +17,10 @@ build:build_qnx8 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64 build:build_qnx8 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64 common --extra_toolchains=@gcc_toolchain//:host_gcc_12 + + +# 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 + diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..7a41a17 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,28 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* +name: Bazel Clippy + +on: + pull_request: + types: [opened, reopened, synchronize] + push: + branches: + - main + merge_group: + types: [checks_requested] + +jobs: + bazel-clippy: + uses: eclipse-score/cicd-workflows/.github/workflows/static-analysis.yml@main + with: + bazel-targets: "//src/..." + bazel-config: "lint" diff --git a/.github/workflows/lint_fmt_clippy.yml b/.github/workflows/lint_fmt.yml similarity index 90% rename from .github/workflows/lint_fmt_clippy.yml rename to .github/workflows/lint_fmt.yml index b6cea8b..08e1ef0 100644 --- a/.github/workflows/lint_fmt_clippy.yml +++ b/.github/workflows/lint_fmt.yml @@ -51,7 +51,7 @@ jobs: profile: minimal toolchain: 1.87.0 override: true - components: rustfmt, clippy + components: rustfmt - name: check code format (rustfmt) uses: actions-rs/cargo@v1 @@ -63,9 +63,3 @@ jobs: with: command: xtask args: check_lic - - - name: check clippy errors - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --features tracing --all-targets --workspace -- -D warnings diff --git a/MODULE.bazel b/MODULE.bazel index 5b2886b..22f3792 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -20,8 +20,11 @@ module( 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 = "score_rust_policies", version = "0.0.4", dev_dependency = True) + 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") diff --git a/README.md b/README.md index 48be16f..3d5b0cc 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,13 @@ Build all targets: bazel build //... ``` +## 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`. + ## Build for QNX8 ### Preparations From 80a21c8efe2d9880ba9586b0ff3882d02ae0df60 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Thu, 5 Feb 2026 09:45:54 +0200 Subject: [PATCH 2/2] cr: fix cr header fixed cr issue Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- .github/workflows/clippy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 7a41a17..e1390fd 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -3,6 +3,7 @@ # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. +# # This program and the accompanying materials are made available under the # terms of the Apache License Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0