Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable native-* rules #1302

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions WARNINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ UPPER_SNAKE_CASE, and providers should be UpperCamelCase ending with `Info`.
* Category name: `native-android`
* Flag in Bazel: [`--incompatible_disable_native_android_rules`](https://github.com/bazelbuild/bazel/issues/8391)
* Automatic fix: yes
* [Disabled by default](buildifier/README.md#linter)
* [Suppress the warning](#suppress): `# buildifier: disable=native-android`

The Android build rules should be loaded from Starlark.
Expand All @@ -684,7 +683,6 @@ as global symbols there.
* Category name: `native-cc`
* Flag in Bazel: [`--incompatible_load_cc_rules_from_bzl`](https://github.com/bazelbuild/bazel/issues/8743)
* Automatic fix: yes
* [Disabled by default](buildifier/README.md#linter)
* [Suppress the warning](#suppress): `# buildifier: disable=native-cc`

The CC build rules should be loaded from Starlark.
Expand All @@ -700,7 +698,6 @@ at the moment it's not required to load Starlark rules.
* Category name: `native-java`
* Flag in Bazel: [`--incompatible_load_java_rules_from_bzl`](https://github.com/bazelbuild/bazel/issues/8746)
* Automatic fix: yes
* [Disabled by default](buildifier/README.md#linter)
* [Suppress the warning](#suppress): `# buildifier: disable=native-java`

The Java build rules should be loaded from Starlark.
Expand All @@ -727,7 +724,6 @@ It can silently modify the semantics of a BUILD file and makes it hard to mainta
* Category name: `native-proto`
* Flag in Bazel: [`--incompatible_load_proto_rules_from_bzl`](https://github.com/bazelbuild/bazel/issues/8922)
* Automatic fix: yes
* [Disabled by default](buildifier/README.md#linter)
* [Suppress the warning](#suppress): `# buildifier: disable=native-proto`

The Proto build rules should be loaded from Starlark.
Expand All @@ -743,7 +739,6 @@ at the moment it's not required to load Starlark rules.
* Category name: `native-py`
* Flag in Bazel: [`--incompatible_load_python_rules_from_bzl`](https://github.com/bazelbuild/bazel/issues/9006)
* Automatic fix: yes
* [Disabled by default](buildifier/README.md#linter)
* [Suppress the warning](#suppress): `# buildifier: disable=native-py`

The Python build rules should be loaded from Starlark.
Expand Down
24 changes: 12 additions & 12 deletions buildifier/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ func TestValidate(t *testing.T) {
"load",
"module-docstring",
"name-conventions",
// "native-android",
"native-android",
"native-build",
// "native-cc",
// "native-java",
"native-cc",
"native-java",
"native-package",
// "native-proto",
// "native-py",
"native-proto",
"native-py",
"no-effect",
"output-group",
"overly-nested-depset",
Expand All @@ -347,7 +347,7 @@ func TestValidate(t *testing.T) {
// "unsorted-dict-items",
"unused-variable",
}},
"warnings plus/minus": {options: "--warnings=+native-cc,-print,-deprecated-function", wantWarnings: []string{
"warnings plus/minus": {options: "--warnings=+unsorted-dict-items,-print,-deprecated-function", wantWarnings: []string{
"attr-applicable_licenses",
"attr-cfg",
"attr-license",
Expand Down Expand Up @@ -381,12 +381,13 @@ func TestValidate(t *testing.T) {
"load",
"module-docstring",
"name-conventions",
// "native-android",
"native-android",
"native-build",
// "native-java",
"native-cc",
"native-java",
"native-package",
// "native-proto",
// "native-py",
"native-proto",
"native-py",
"no-effect",
"output-group",
"overly-nested-depset",
Expand All @@ -406,9 +407,8 @@ func TestValidate(t *testing.T) {
"uninitialized",
"unnamed-macro",
"unreachable",
// "unsorted-dict-items",
"unused-variable",
"native-cc",
"unsorted-dict-items",
}},
"warnings error": {options: "--warnings=native-cc,-print,-deprecated-function", wantErr: fmt.Errorf(`warning categories with modifiers ("+" or "-") can't be mixed with raw warning categories`)},
} {
Expand Down
5 changes: 0 additions & 5 deletions warn/warn.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,6 @@ var MultiFileWarningMap = map[string]func(f *build.File, fileReader *FileReader)
// for all files and cause too much diff noise when applied.
var nonDefaultWarnings = map[string]bool{
"unsorted-dict-items": true, // dict items should be sorted
"native-android": true, // disables native android rules
"native-cc": true, // disables native cc rules
"native-java": true, // disables native java rules
"native-proto": true, // disables native proto rules
"native-py": true, // disables native python rules
}

// fileWarningWrapper is a wrapper that converts a file warning function to a generic function.
Expand Down