diff --git a/examples/where_is_my_output/show_all_outputs.bzl b/examples/where_is_my_output/show_all_outputs.bzl index e7e90b1b..7391d9c5 100644 --- a/examples/where_is_my_output/show_all_outputs.bzl +++ b/examples/where_is_my_output/show_all_outputs.bzl @@ -12,13 +12,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +""" +Extract the paths to the various outputs of pkg_deb -# Extract the paths to the various outputs of pkg_deb -# -# Usage: -# bazel cquery //pkg:deb --output=starlark --starlark:file=show_all_outputs.bzl -# +Usage: + bazel cquery //pkg:deb --output=starlark --starlark:file=show_all_outputs.bzl +""" +# buildifier: disable=function-docstring def format(target): provider_map = providers(target) output_group_info = provider_map["OutputGroupInfo"] diff --git a/pkg/install.bzl b/pkg/install.bzl index bdce64fb..e7b0e424 100644 --- a/pkg/install.bzl +++ b/pkg/install.bzl @@ -24,7 +24,6 @@ load("//pkg/private:pkg_files.bzl", "create_mapping_context_from_ctx", "process_ def _pkg_install_script_impl(ctx): script_file = ctx.actions.declare_file(ctx.attr.name + ".py") - fragments = [] mapping_context = create_mapping_context_from_ctx(ctx, label = ctx.label, default_mode = "0644") for src in ctx.attr.srcs: process_src( diff --git a/pkg/private/pkg_files.bzl b/pkg/private/pkg_files.bzl index 6fcf22fb..070947d3 100644 --- a/pkg/private/pkg_files.bzl +++ b/pkg/private/pkg_files.bzl @@ -228,7 +228,7 @@ def _process_pkg_symlink(mapping_context, pkg_symlink_info, origin): link_to = pkg_symlink_info.target, ) -def _process_pkg_filegroup(mapping_context, pkg_filegroup_info, origin): +def _process_pkg_filegroup(mapping_context, pkg_filegroup_info, _): if hasattr(pkg_filegroup_info, "pkg_dirs"): for d in pkg_filegroup_info.pkg_dirs: _process_pkg_dirs(mapping_context, d[0], d[1]) diff --git a/pkg/releasing/BUILD b/pkg/releasing/BUILD index b4f52f53..4036c0fd 100644 --- a/pkg/releasing/BUILD +++ b/pkg/releasing/BUILD @@ -18,8 +18,7 @@ package( filegroup( name = "standard_package", - srcs = glob([ - "BUILD", + srcs = ["BUILD"] + glob([ "*.bzl", "*.py", ]), diff --git a/pkg/releasing/defs.bzl b/pkg/releasing/defs.bzl index 0cebfb07..52f3cd49 100644 --- a/pkg/releasing/defs.bzl +++ b/pkg/releasing/defs.bzl @@ -1,5 +1,6 @@ """Implementation for print_rel_notes.""" +# buildifier: disable=function-docstring def print_rel_notes( name, repo, diff --git a/pkg/rpm_pfg.bzl b/pkg/rpm_pfg.bzl index 3240c8a1..300e99a2 100644 --- a/pkg/rpm_pfg.bzl +++ b/pkg/rpm_pfg.bzl @@ -180,7 +180,7 @@ def _process_files(pfi, origin_label, grouping_label, file_base, dest_check_map, abs_dest, )) -def _process_dirs(pdi, origin_label, grouping_label, file_base, dest_check_map, packaged_directories, rpm_files_list, install_script_pieces): +def _process_dirs(pdi, origin_label, grouping_label, file_base, dest_check_map, _, rpm_files_list, install_script_pieces): for dest in pdi.dirs: metadata = _package_contents_metadata(origin_label, grouping_label) if dest in dest_check_map: @@ -195,7 +195,7 @@ def _process_dirs(pdi, origin_label, grouping_label, file_base, dest_check_map, abs_dirname, )) -def _process_symlink(psi, origin_label, grouping_label, file_base, dest_check_map, packaged_directories, rpm_files_list, install_script_pieces): +def _process_symlink(psi, origin_label, grouping_label, file_base, dest_check_map, _, rpm_files_list, install_script_pieces): metadata = _package_contents_metadata(origin_label, grouping_label) if psi.destination in dest_check_map: _conflicting_contents_error(psi.destination, metadata, dest_check_map[psi.destination]) @@ -258,7 +258,7 @@ def _pkg_rpm_impl(ctx): ctx.attr.architecture, ) - outputs, output_file, output_name = setup_output_files( + _, output_file, _ = setup_output_files( ctx, package_file_name = package_file_name, default_output_file = default_file, diff --git a/pkg/verify_archive.bzl b/pkg/verify_archive.bzl index 07a9f0eb..d132d497 100644 --- a/pkg/verify_archive.bzl +++ b/pkg/verify_archive.bzl @@ -85,6 +85,7 @@ _gen_verify_archive_test_main = rule( }, ) +# buildifier: disable=function-docstring-args def verify_archive_test( name, target, diff --git a/tests/mappings/mappings_external_repo_test.bzl b/tests/mappings/mappings_external_repo_test.bzl index e9966584..7b9b0ac1 100644 --- a/tests/mappings/mappings_external_repo_test.bzl +++ b/tests/mappings/mappings_external_repo_test.bzl @@ -14,8 +14,8 @@ """Tests for file mapping routines in pkg/mappings.bzl""" -load(":mappings_test.bzl", "pkg_files_contents_test") load("//pkg:mappings.bzl", "pkg_files", "strip_prefix") +load(":mappings_test.bzl", "pkg_files_contents_test") ########## # pkg_files tests involving external repositories @@ -106,6 +106,7 @@ def _test_pkg_files_extrepo(): expected_dests = ["usr/bin/dir/extproj.sh"], ) +# buildifier: disable=unnamed-macro def mappings_external_repo_analysis_tests(): """Declare mappings.bzl analysis tests""" _test_pkg_files_extrepo() diff --git a/tests/mappings/mappings_test.bzl b/tests/mappings/mappings_test.bzl index d2f5ca95..d5dc0c26 100644 --- a/tests/mappings/mappings_test.bzl +++ b/tests/mappings/mappings_test.bzl @@ -883,6 +883,7 @@ def _strip_prefix_test_impl(ctx): strip_prefix_test = unittest.make(_strip_prefix_test_impl) +# buildifier: disable=unnamed-macro def mappings_analysis_tests(): """Declare mappings.bzl analysis tests""" _test_pkg_files_contents() @@ -969,6 +970,7 @@ _gen_manifest_test_main = rule( }, ) +# buildifier: disable=function-docstring-args def manifest_golden_test(name, target, expected): """Tests that a content manifest file matches a golden copy. diff --git a/tests/rpm/analysis_tests.bzl b/tests/rpm/analysis_tests.bzl index b518542d..fd3317fb 100644 --- a/tests/rpm/analysis_tests.bzl +++ b/tests/rpm/analysis_tests.bzl @@ -49,7 +49,7 @@ def _declare_pkg_rpm(name, srcs_ungrouped, tags = None, **kwargs): **kwargs ) -def _declare_conflicts_test(name, srcs, **kwargs): +def _declare_conflicts_test(name, srcs): rpm_name = name + "_rpm" _declare_pkg_rpm( name = rpm_name, @@ -226,7 +226,7 @@ package_naming_test = analysistest.make( ) # Dummy substitution set, used in below test cases -def _dummy_pkg_variables_impl(ctx): +def _dummy_pkg_variables_impl(_): return [ PackageVariablesInfo( values = { @@ -302,7 +302,7 @@ def _test_naming(name): ], ) -def analysis_tests(name, **kwargs): +def analysis_tests(name): # Need to test: # # - Mutual exclusivity of certain options (low priority) diff --git a/tests/rpm/toolchain_tests.bzl b/tests/rpm/toolchain_tests.bzl index 0f6a499a..9fffa8ea 100644 --- a/tests/rpm/toolchain_tests.bzl +++ b/tests/rpm/toolchain_tests.bzl @@ -119,5 +119,6 @@ def _create_toolchain_creation_tests(): expect_path = "/usr/bin/foo", ) +# buildifier: disable=unnamed-macro def create_toolchain_analysis_tests(): _create_toolchain_creation_tests() diff --git a/tests/tar/BUILD b/tests/tar/BUILD index a4cbc146..392f5849 100644 --- a/tests/tar/BUILD +++ b/tests/tar/BUILD @@ -19,6 +19,8 @@ load("@rules_python//python:defs.bzl", "py_test") # buildifier: disable=bzl-visibility load("//pkg:mappings.bzl", "pkg_attributes", "pkg_files", "pkg_mkdirs", "pkg_mklink") load("//pkg:verify_archive.bzl", "verify_archive_test") + +# buildifier: disable=bzl-visibility load("//pkg/private/tar:tar.bzl", "SUPPORTED_TAR_COMPRESSIONS", "pkg_tar") load("//tests:my_package_name.bzl", "my_package_naming") load("//tests/util:defs.bzl", "directory", "fake_artifact", "link_tree") diff --git a/toolchains/git/git_configure.bzl b/toolchains/git/git_configure.bzl index c1f9a0e7..2553c918 100644 --- a/toolchains/git/git_configure.bzl +++ b/toolchains/git/git_configure.bzl @@ -58,6 +58,7 @@ _find_system_git = repository_rule( }, ) +# buildifier: disable=function-docstring-args def experimental_find_system_git(name, workspace_file = None, verbose = False): """Create a toolchain that lets you run git. diff --git a/toolchains/rpm/rpmbuild.bzl b/toolchains/rpm/rpmbuild.bzl index 3aa0ea04..7e227522 100644 --- a/toolchains/rpm/rpmbuild.bzl +++ b/toolchains/rpm/rpmbuild.bzl @@ -70,5 +70,6 @@ is_rpmbuild_available = rule( toolchains = ["@rules_pkg//toolchains/rpm:rpmbuild_toolchain_type"], ) +# buildifier: disable=unnamed-macro def rpmbuild_register_toolchains(): native.register_toolchains("@rules_pkg//toolchains/rpm:rpmbuild_missing_toolchain")