Chris Frantz | 340e623 | 2021-08-25 15:56:28 -0700 | [diff] [blame] | 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 | |
Drew Macrae | d3029c7 | 2021-09-24 19:24:09 +0000 | [diff] [blame] | 5 | load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") |
Chris Frantz | b231f11 | 2021-12-02 15:42:10 -0800 | [diff] [blame] | 6 | load("//rules:quality.bzl", "clang_format_check", "html_coverage_report", "license_check") |
Drew Macrae | d3029c7 | 2021-09-24 19:24:09 +0000 | [diff] [blame] | 7 | |
Chris Frantz | e745416 | 2021-08-25 14:43:05 -0700 | [diff] [blame] | 8 | package(default_visibility = ["//visibility:public"]) |
Drew Macrae | d3029c7 | 2021-09-24 19:24:09 +0000 | [diff] [blame] | 9 | |
| 10 | buildifier( |
Chris Frantz | 6fb3f4e | 2021-11-12 10:56:10 -0800 | [diff] [blame] | 11 | name = "buildifier_fix", |
Drew Macrae | d3029c7 | 2021-09-24 19:24:09 +0000 | [diff] [blame] | 12 | exclude_patterns = ["./**/vendor/**"], |
| 13 | ) |
Chris Frantz | 3f87fe0 | 2021-11-12 09:59:04 -0800 | [diff] [blame] | 14 | |
Chris Frantz | 6fb3f4e | 2021-11-12 10:56:10 -0800 | [diff] [blame] | 15 | buildifier( |
| 16 | name = "buildifier_check", |
| 17 | diff_command = "diff -u", |
| 18 | exclude_patterns = ["./**/vendor/**"], |
| 19 | mode = "diff", |
| 20 | ) |
| 21 | |
Chris Frantz | 3f87fe0 | 2021-11-12 09:59:04 -0800 | [diff] [blame] | 22 | license_check( |
| 23 | name = "license_check", |
| 24 | ) |
Chris Frantz | 6fb3f4e | 2021-11-12 10:56:10 -0800 | [diff] [blame] | 25 | |
| 26 | clang_format_check( |
| 27 | name = "clang_format_check", |
| 28 | exclude_patterns = [ |
| 29 | # Vendored source code dirs |
| 30 | "./**/vendor/**", |
| 31 | # Rust cargo build dirs |
| 32 | "./**/target/**", |
| 33 | # Meson build dirs |
| 34 | "./build-out/**", |
| 35 | "./build-bin/**", |
| 36 | # fusesoc build dir |
| 37 | "./build/**", |
| 38 | ], |
| 39 | mode = "diff", |
| 40 | ) |
| 41 | |
| 42 | clang_format_check( |
| 43 | name = "clang_format_fix", |
| 44 | exclude_patterns = [ |
| 45 | # Vendored source code dirs |
| 46 | "./**/vendor/**", |
| 47 | # Rust cargo build dirs |
| 48 | "./**/target/**", |
| 49 | # Meson build dirs |
| 50 | "./build-out/**", |
| 51 | "./build-bin/**", |
| 52 | # fusesoc build dir |
| 53 | "./build/**", |
| 54 | ], |
| 55 | mode = "fix", |
| 56 | ) |
Chris Frantz | 6da32ea | 2021-11-22 13:12:08 -0800 | [diff] [blame] | 57 | |
Chris Frantz | b231f11 | 2021-12-02 15:42:10 -0800 | [diff] [blame] | 58 | html_coverage_report( |
| 59 | name = "html_coverage_report", |
| 60 | ) |
| 61 | |
Chris Frantz | 6da32ea | 2021-11-22 13:12:08 -0800 | [diff] [blame] | 62 | filegroup( |
| 63 | name = "cores", |
| 64 | srcs = [ |
| 65 | "check_tool_requirements.core", |
| 66 | "topgen.core", |
| 67 | "topgen-reg-only.core", |
| 68 | ], |
| 69 | ) |