2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-12-04 14:02:23 +00:00

chore: turn on more basic precommit checks

In particular this makes our bazelrc presets more compliant with client codebases, ensuring they can copy these files and not trip on their own pre-commit check
This commit is contained in:
Alex Eagle 2023-02-17 10:12:41 -08:00
parent fde705ba8c
commit 1df2becc7a
26 changed files with 74 additions and 67 deletions

View file

@ -24,3 +24,15 @@ repos:
rev: "v2.4.0" rev: "v2.4.0"
hooks: hooks:
- id: prettier - id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: end-of-file-fixer
exclude: &exclude_pattern "^(docs|e2e|lib/tests)/"
- id: mixed-line-ending
- id: trailing-whitespace

View file

@ -175,4 +175,3 @@
of your accepting any such warranty or additional liability. of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS

View file

@ -4,7 +4,7 @@ Users should *not* need to install these. If users see a load()
statement from these, that's a bug in our distribution. statement from these, that's a bug in our distribution.
""" """
load("//lib:repositories.bzl", "register_jq_toolchains", "register_yq_toolchains", "register_coreutils_toolchains") load("//lib:repositories.bzl", "register_coreutils_toolchains", "register_jq_toolchains", "register_yq_toolchains")
load("//lib:utils.bzl", http_archive = "maybe_http_archive") load("//lib:utils.bzl", http_archive = "maybe_http_archive")
# buildifier: disable=unnamed-macro # buildifier: disable=unnamed-macro

View file

@ -44,21 +44,21 @@ COREUTILS_VERSIONS = {
"0.0.16": { "0.0.16": {
"linux_arm64": { "linux_arm64": {
"filename": "coreutils-0.0.16-aarch64-unknown-linux-gnu.tar.gz", "filename": "coreutils-0.0.16-aarch64-unknown-linux-gnu.tar.gz",
"sha256": "sha256-6tExkcMMHe7+59M9Mp9UKeq+g0y+juO7oakZfVOtOqw=" "sha256": "sha256-6tExkcMMHe7+59M9Mp9UKeq+g0y+juO7oakZfVOtOqw=",
}, },
"darwin_amd64": { "darwin_amd64": {
"filename": "coreutils-0.0.16-x86_64-apple-darwin.tar.gz", "filename": "coreutils-0.0.16-x86_64-apple-darwin.tar.gz",
"sha256": "sha256-lQYWAuPOKS6XxwArZdiKIyczwppTVwjF4ml0iKBaB9s=" "sha256": "sha256-lQYWAuPOKS6XxwArZdiKIyczwppTVwjF4ml0iKBaB9s=",
}, },
"windows_amd64": { "windows_amd64": {
"filename": "coreutils-0.0.16-x86_64-pc-windows-msvc.zip", "filename": "coreutils-0.0.16-x86_64-pc-windows-msvc.zip",
"sha256": "sha256-z5E1onYAKZoaUt2U1cv1t8UHPsJinYktEd6SpE2u07o=" "sha256": "sha256-z5E1onYAKZoaUt2U1cv1t8UHPsJinYktEd6SpE2u07o=",
}, },
"linux_amd64": { "linux_amd64": {
"filename": "coreutils-0.0.16-x86_64-unknown-linux-gnu.tar.gz", "filename": "coreutils-0.0.16-x86_64-unknown-linux-gnu.tar.gz",
"sha256": "sha256-Slf4qKf19sAWoK2pUVluAitmL3N2uz4eWpV4eibIEW0=" "sha256": "sha256-Slf4qKf19sAWoK2pUVluAitmL3N2uz4eWpV4eibIEW0=",
} },
} },
} }
CoreUtilsInfo = provider( CoreUtilsInfo = provider(
@ -99,7 +99,7 @@ coreutils_toolchain = rule(
attrs = { attrs = {
"binary": attr.label( "binary": attr.label(
mandatory = True, mandatory = True,
allow_single_file = True allow_single_file = True,
), ),
}, },
) )
@ -176,7 +176,7 @@ def _coreutils_platform_repo_impl(rctx):
filename = COREUTILS_VERSIONS[rctx.attr.version][platform]["filename"] filename = COREUTILS_VERSIONS[rctx.attr.version][platform]["filename"]
url = "https://github.com/uutils/coreutils/releases/download/{}/{}".format( url = "https://github.com/uutils/coreutils/releases/download/{}/{}".format(
rctx.attr.version, rctx.attr.version,
filename filename,
) )
rctx.download_and_extract( rctx.download_and_extract(
url = url, url = url,

View file

@ -57,4 +57,3 @@ else
fail "files \"{file1}\" and \"{file2}\" differ. {fail_msg}" fail "files \"{file1}\" and \"{file2}\" differ. {fail_msg}"
fi fi
fi fi

View file

@ -166,7 +166,6 @@ def _mixed_wrapping_globstar(ctx):
mixed_wrapper_globstar_test = unittest.make(_mixed_wrapping_globstar) mixed_wrapper_globstar_test = unittest.make(_mixed_wrapping_globstar)
def _is_glob(ctx): def _is_glob(ctx):
env = unittest.begin(ctx) env = unittest.begin(ctx)
@ -218,5 +217,5 @@ def glob_match_test_suite():
unittest.suite( unittest.suite(
"is_glob", "is_glob",
partial.make(is_glob_test, timeout = "short") partial.make(is_glob_test, timeout = "short"),
) )

View file

@ -1,5 +1,3 @@
{ {
"extends": [ "extends": ["config:base"]
"config:base"
]
} }