bazel-contrib / bazel-contrib/buildtools

renaming buildifier warning categories breaks compatibility

Open
#1,336 2 comments 2 reactions 0 assignees View on GitHub
P2
Dominant language
Go
Stars
1.2k
Forks
471
Avg merge
2d 22h
Merged PRs (30d)
13

Description

This is sort of bug report and sort of a feature request.

We've been using the native-cc warnings (and added them to .buildifier.json in our tree) to try to stay ahead of the migration:
```
{
"AddTables": ".buildifier-tables.json",
"Warnings": "+native-cc,+native-py"
}
```

However, [this PR](https://github.com/bazelbuild/buildtools/pull/1326) renamed the category, and as a result, our tree is broken in a point release of buildifier (8.0.2, iirc)
```
2025/02/28 12:09:54 unexpected warning "native-cc"
```

So, that's the bug report portion. The feature request portion:
- Could we have a flag to make "unexpected warning" be a warning instead of an error?
- Could buildifier somehow behave like bazelisk and support .bazelversion so we can pin it more reliably?
- Failing those, could category names be treated as part of the feature interface?

Thanks :)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing PR 1326 and the .buildifier.json example in the issue to understand the warning-category rename and its compatibility impact. The issue presents several possible resolutions rather than a defined change, so completion would require choosing and specifying one approach, including the expected behavior for existing category names and unexpected warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.