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
7 changes: 7 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
53 changes: 11 additions & 42 deletions .github/workflows/lint_clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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")

# S-CORE process rules
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.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
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading