diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..643916c --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +7.3.1 diff --git a/.github/workflows/licence-checker.yml b/.github/workflows/licence-checker.yml index f9a9f6f..a32433d 100644 --- a/.github/workflows/licence-checker.yml +++ b/.github/workflows/licence-checker.yml @@ -22,9 +22,9 @@ jobs: with: python-version: 3.9 - name: Check formatting with Ruff - run: bazel run :format.check + run: bazel run //quality:format.check - name: Run Licence Checker - run: bazel run //:licence-check + run: bazel run //quality:licence-check - name: Test Licence Checker run: | cd tests diff --git a/BUILD b/BUILD index 865bf5d..9f9e5f5 100644 --- a/BUILD +++ b/BUILD @@ -1,31 +1,3 @@ # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 - -load("//rules:rules.bzl", "licence_check") -load("@aspect_rules_lint//format:defs.bzl", "format_multirun") - -licence_check( - name = "licence-check", - exclude_patterns = [".style.yapf"], - licence = """ - Copyright lowRISC contributors. - Licensed under the Apache License, Version 2.0, see LICENSE for details. - SPDX-License-Identifier: Apache-2.0 - """, -) - -alias( - name = "ruff", - actual = select({ - "@bazel_tools//src/conditions:linux_x86_64": "@ruff_x86_64-unknown-linux-gnu//:ruff", - "@bazel_tools//src/conditions:linux_aarch64": "@ruff_aarch64-unknown-linux-gnu//:ruff", - "@bazel_tools//src/conditions:darwin_arm64": "@ruff_aarch64-apple-darwin//:ruff", - "@bazel_tools//src/conditions:darwin_x86_64": "@ruff_x86_64-apple-darwin//:ruff", - }), -) - -format_multirun( - name = "format", - python = ":ruff", -) diff --git a/quality/BUILD b/quality/BUILD new file mode 100644 index 0000000..0509fcd --- /dev/null +++ b/quality/BUILD @@ -0,0 +1,33 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + +load("//rules:rules.bzl", "licence_check") +load("@aspect_rules_lint//format:defs.bzl", "format_multirun") + +package(default_visibility = ["//visibility:private"]) + +licence_check( + name = "licence-check", + exclude_patterns = [".style.yapf"], + licence = """ + Copyright lowRISC contributors. + Licensed under the Apache License, Version 2.0, see LICENSE for details. + SPDX-License-Identifier: Apache-2.0 + """, +) + +alias( + name = "ruff", + actual = select({ + "@bazel_tools//src/conditions:linux_x86_64": "@ruff_x86_64-unknown-linux-gnu//:ruff", + "@bazel_tools//src/conditions:linux_aarch64": "@ruff_aarch64-unknown-linux-gnu//:ruff", + "@bazel_tools//src/conditions:darwin_arm64": "@ruff_aarch64-apple-darwin//:ruff", + "@bazel_tools//src/conditions:darwin_x86_64": "@ruff_x86_64-apple-darwin//:ruff", + }), +) + +format_multirun( + name = "format", + python = ":ruff", +)