diff --git a/.bazelrc b/.bazelrc index d1f17d7..d144e3b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,10 @@ +############################################################################### +## Bazel Configuration Flags +## +## `.bazelrc` is a Bazel configuration file. +## https://bazel.build/docs/best-practices#bazelrc-file +############################################################################### + test --test_output=errors # Fix the excessive rebuilding when using anything that depends on protobuf rules @@ -5,8 +12,6 @@ test --test_output=errors common --incompatible_strict_action_env common --enable_bzlmod -try-import user.bazelrc - # To update these lines, execute # `bazel run @rules_bazel_integration_test//tools:update_deleted_packages` build --deleted_packages=examples/check_glob,examples/optional_attributes @@ -15,3 +20,26 @@ query --deleted_packages=examples/check_glob,examples/optional_attributes # Enable the aspect build --aspects=//shellcheck:shellcheck_aspect.bzl%shellcheck_aspect build --output_groups=+shellcheck_checks + +############################################################################### +## Incompatibility flags +############################################################################### + +# https://github.com/bazelbuild/bazel/issues/8195 +build --incompatible_disallow_empty_glob=true + +# https://github.com/bazelbuild/bazel/issues/12821 +build --nolegacy_external_runfiles + +# https://github.com/bazelbuild/bazel/issues/23043. +build --incompatible_autoload_externally= + +############################################################################### +## Custom user flags +## +## This should always be the last thing in the `.bazelrc` file to ensure +## consistent behavior when setting flags in that file as `.bazelrc` files are +## evaluated top to bottom. +############################################################################### + +try-import user.bazelrc diff --git a/BUILD.bazel b/BUILD.bazel index 34d6c1d..18f0e78 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -2,8 +2,6 @@ filegroup( name = "distribution", srcs = [ "BUILD.bazel", - "def.bzl", - "deps.bzl", "CHANGELOG.md", "LICENSE", "MODULE.bazel", diff --git a/README.md b/README.md index 5840c54..11882a6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ bazel run @rules_shellcheck//:shellcheck -- And you can define a lint target: ```starlark -load("@rules_shellcheck//:def.bzl", "shellcheck", "shellcheck_test") +load("@rules_shellcheck//shellcheck:shellcheck_test.bzl", "shellcheck_test") shellcheck_test( name = "shellcheck_test", diff --git a/WORKSPACE b/WORKSPACE index 3b6c188..e553383 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,5 +1 @@ workspace(name = "rules_shellcheck") - -load("//:deps.bzl", "shellcheck_dependencies") - -shellcheck_dependencies() diff --git a/def.bzl b/def.bzl deleted file mode 100644 index c55d407..0000000 --- a/def.bzl +++ /dev/null @@ -1,9 +0,0 @@ -"""This file provides all user facing functions. -""" - -load( - "//shellcheck:defs.bzl", - _shellcheck_test = "shellcheck_test", -) - -shellcheck_test = _shellcheck_test diff --git a/deps.bzl b/deps.bzl deleted file mode 100644 index aa50a9f..0000000 --- a/deps.bzl +++ /dev/null @@ -1,9 +0,0 @@ -"""Provides shellcheck dependencies on all supported platforms: -- Linux 64-bit and ARM64 -- OSX 64-bit -""" - -# buildifier: disable=bzl-visibility -load("//shellcheck/internal:extensions.bzl", _shellcheck_dependencies = "shellcheck_dependencies") - -shellcheck_dependencies = _shellcheck_dependencies diff --git a/examples/check_glob/BUILD.bazel b/examples/check_glob/BUILD.bazel index 2c578fe..0c28f50 100644 --- a/examples/check_glob/BUILD.bazel +++ b/examples/check_glob/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_shellcheck//:def.bzl", "shellcheck_test") +load("@rules_shellcheck//shellcheck:shellcheck_test.bzl", "shellcheck_test") shellcheck_test( name = "shellcheck_all", diff --git a/examples/optional_attributes/BUILD.bazel b/examples/optional_attributes/BUILD.bazel index 562a7a9..e91cf15 100644 --- a/examples/optional_attributes/BUILD.bazel +++ b/examples/optional_attributes/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_shellcheck//:def.bzl", "shellcheck_test") +load("@rules_shellcheck//shellcheck:shellcheck_test.bzl", "shellcheck_test") shellcheck_test( name = "shellcheck_all", diff --git a/internal/pkg/BUILD.bazel b/internal/pkg/BUILD.bazel index 4fc6250..38fef3b 100644 --- a/internal/pkg/BUILD.bazel +++ b/internal/pkg/BUILD.bazel @@ -1,7 +1,7 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_pkg//pkg:tar.bzl", "pkg_tar") load("@rules_shell//shell:sh_binary.bzl", "sh_binary") -load("//:def.bzl", "shellcheck_test") +load("//shellcheck:shellcheck_test.bzl", "shellcheck_test") pkg_files( name = "files",