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

Add --lint=fix and --lint=warn to buildifier #426

Closed
wants to merge 1 commit into from

Conversation

nlou9
Copy link

@nlou9 nlou9 commented Nov 19, 2024

Add flag --lint=fix and --lint=warn to the buildifier.
https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md


Changes are visible to end-users: yes/no

  • Searched for relevant documentation and updated as needed: yes/no
  • Breaking change (forces users to change their own code or config): yes/no
  • Suggested release notes appear below: yes/no

Test plan

  • Covered by existing test cases
  • New test cases added
  • Manual testing; please provide instructions so we can reproduce:

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2024

CLA assistant check
All committers have signed the CLA.

@nlou9 nlou9 marked this pull request as ready for review November 19, 2024 04:50
Copy link
Member

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

This looks incorrect because Buildifier is run here as a formatter, not a linter. See the README for the design of how they are treated separately

@nlou9
Copy link
Author

nlou9 commented Nov 19, 2024

thanks, I will move the buildifier linter part to the lint section.

@alexeagle
Copy link
Member

We don't have a buildifier linter here yet, because the linting is based on an aspect walking the dependency graph, and there are typically no targets that list BUILD and *.bzl files as their sources. I'm not sure if it's worth introducing bzl_library in every package.

@nlou9
Copy link
Author

nlou9 commented Nov 19, 2024

Instead of adding a liner for Buildifier, in short term I wonder if we could allow users to extend CHECK_FLAGS and FIX_FLAGS. I think this might also be useful in other scenarios.

@alexeagle
Copy link
Member

#377

@alexeagle
Copy link
Member

closing as dupe of #377 - thanks for helping out!

@alexeagle alexeagle closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants