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
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ test --test_output=errors
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

# Clippy linting (enabled by default)
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build --output_groups=+clippy_checks
build --@rules_rust//rust/settings:clippy.toml=@score_rust_policies//clippy/strict:clippy.toml

try-import %workspace%/user.bazelrc
28 changes: 28 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -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-target: "build //:clippy"
12 changes: 12 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@rules_rust//rust:defs.bzl", "rust_clippy")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "cli_helper", "copyright_checker", "dash_license_checker", "setup_starpls", "use_format_targets")
load("//:project_config.bzl", "PROJECT_CONFIG")
Expand Down Expand Up @@ -86,6 +87,17 @@ cli_helper(
# Add target for formatting checks
use_format_targets()

rust_clippy(
name = "clippy",
testonly = True,
tags = ["manual"],
visibility = ["//visibility:public"],
deps = [
"//src/rust/rust_kvs",
"//src/rust/rust_kvs_tool:kvs_tool",
],
)

alias(
name = "kvs_cpp",
actual = "//src/cpp/src:kvs_cpp",
Expand Down
3 changes: 3 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ use_repo(pip, "pip_score_venv_test")
# rust
bazel_dep(name = "rules_rust", version = "0.56.0")

# Shared Rust policies (Clippy config, etc.), overridden locally during development.
bazel_dep(name = "score_rust_policies", version = "0.0.2", dev_dependency = True)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency = True)
rust.toolchain(
edition = "2021",
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ Run selected test target:
bazel test <TARGET_NAME>
```

## Clippy

- Clippy runs by default via `.bazelrc` on all Rust targets (Rust tests are tagged `no-clippy`).
- Use `bazel build //:clippy` if you want an explicit lint-only target, or `bazel build //src/rust/...` while building.
- The Clippy config comes from `@score_rust_policies//clippy/strict:clippy.toml`.

## Cargo-based operations

Please use Bazel whenever possible.
Expand Down
Loading