Skip to content

Commit 12c8acb

Browse files
committed
Move quality checks to private package
The targets in this package are only for local testing and do not need to be exposed to depending Bazel modules. This prevents errors when querying the whole module when the `aspect_rules_lint` dependency won't be available. Signed-off-by: James Wainwright <james.wainwright@lowrisc.org>
1 parent c1b420e commit 12c8acb

File tree

3 files changed

+35
-30
lines changed

3 files changed

+35
-30
lines changed

.github/workflows/licence-checker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
with:
2323
python-version: 3.9
2424
- name: Check formatting with Ruff
25-
run: bazel run :format.check
25+
run: bazel run //quality:format.check
2626
- name: Run Licence Checker
27-
run: bazel run //:licence-check
27+
run: bazel run //quality:licence-check
2828
- name: Test Licence Checker
2929
run: |
3030
cd tests

BUILD

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
11
# Copyright lowRISC contributors.
22
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
# SPDX-License-Identifier: Apache-2.0
4-
5-
load("//rules:rules.bzl", "licence_check")
6-
load("@aspect_rules_lint//format:defs.bzl", "format_multirun")
7-
8-
licence_check(
9-
name = "licence-check",
10-
exclude_patterns = [".style.yapf"],
11-
licence = """
12-
Copyright lowRISC contributors.
13-
Licensed under the Apache License, Version 2.0, see LICENSE for details.
14-
SPDX-License-Identifier: Apache-2.0
15-
""",
16-
)
17-
18-
alias(
19-
name = "ruff",
20-
actual = select({
21-
"@bazel_tools//src/conditions:linux_x86_64": "@ruff_x86_64-unknown-linux-gnu//:ruff",
22-
"@bazel_tools//src/conditions:linux_aarch64": "@ruff_aarch64-unknown-linux-gnu//:ruff",
23-
"@bazel_tools//src/conditions:darwin_arm64": "@ruff_aarch64-apple-darwin//:ruff",
24-
"@bazel_tools//src/conditions:darwin_x86_64": "@ruff_x86_64-apple-darwin//:ruff",
25-
}),
26-
)
27-
28-
format_multirun(
29-
name = "format",
30-
python = ":ruff",
31-
)

quality/BUILD

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright lowRISC contributors.
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
load("//rules:rules.bzl", "licence_check")
6+
load("@aspect_rules_lint//format:defs.bzl", "format_multirun")
7+
8+
package(default_visibility = ["//visibility:private"])
9+
10+
licence_check(
11+
name = "licence-check",
12+
exclude_patterns = [".style.yapf"],
13+
licence = """
14+
Copyright lowRISC contributors.
15+
Licensed under the Apache License, Version 2.0, see LICENSE for details.
16+
SPDX-License-Identifier: Apache-2.0
17+
""",
18+
)
19+
20+
alias(
21+
name = "ruff",
22+
actual = select({
23+
"@bazel_tools//src/conditions:linux_x86_64": "@ruff_x86_64-unknown-linux-gnu//:ruff",
24+
"@bazel_tools//src/conditions:linux_aarch64": "@ruff_aarch64-unknown-linux-gnu//:ruff",
25+
"@bazel_tools//src/conditions:darwin_arm64": "@ruff_aarch64-apple-darwin//:ruff",
26+
"@bazel_tools//src/conditions:darwin_x86_64": "@ruff_x86_64-apple-darwin//:ruff",
27+
}),
28+
)
29+
30+
format_multirun(
31+
name = "format",
32+
python = ":ruff",
33+
)

0 commit comments

Comments
 (0)