Skip to content

Add configuration file for Buildifier#1062

Merged
mhucka merged 1 commit intoquantumlib:mainfrom
mhucka:add-buildifier-config
May 10, 2026
Merged

Add configuration file for Buildifier#1062
mhucka merged 1 commit intoquantumlib:mainfrom
mhucka:add-buildifier-config

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented May 10, 2026

Add .buildifier.json to tell Buildifier that it should not complain about the use of CcInfo in our Bazel files. We still use an old version of Bazel, and Buildifier complains about uses of CcInfo with a message like this:

native-cc-info: Symbol "CcInfo" is not global anymore
and needs to be loaded from "@rules_cc//cc/common:cc_info.bzl".

But CcInfo works as expected in Bazel 6.5.0.

Add `.buildifier.json` to tell Buildifier that it should not complain
about the use of "CcInfo" in our Bazel files. We still use an old
version of Bazel, and Buildifier complains about uses of CcInfo with a
message like this:

```
native-cc-info: Symbol "CcInfo" is not global anymore
and needs to be loaded from "@rules_cc//cc/common:cc_info.bzl".
```

But CcInfo works as expected in Bazel 6.5.0.
@github-actions github-actions Bot added the size: XS <10 lines changed label May 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a .buildifier.json configuration file. The reviewer pointed out that the file violates the repository's style guide, which requires a license header for any file longer than two lines. Additionally, the reviewer identified that the configuration key used, warningsList, is incorrect and should be warnings for the tool to recognize it. A suggestion was made to condense the JSON to a single line to comply with the style guide without needing a license header.

Comment thread .buildifier.json
Comment on lines +1 to +5
{
"warningsList": [
"-native-cc-info"
]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The repository style guide (line 116) requires a license header for any file longer than 2 lines. Since standard JSON does not support comments, this file should be condensed to a single line to remain valid while complying with the style guide. Additionally, the configuration key for Buildifier is warnings, not warningsList; using the incorrect key will cause the configuration to be ignored by the tool.

{"warnings": ["-native-cc-info"]}
References
  1. Every source code file longer than 2 lines must begin with a header comment with the copyright and license. (link)

@mhucka mhucka merged commit 19326a6 into quantumlib:main May 10, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant