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

constant-glob fails to lint when the first argument is named #1256

Closed
mark-thm opened this issue Mar 21, 2024 · 0 comments · Fixed by #1257
Closed

constant-glob fails to lint when the first argument is named #1256

mark-thm opened this issue Mar 21, 2024 · 0 comments · Fixed by #1257

Comments

@mark-thm
Copy link
Contributor

constant-glob does not correctly lint constant globs when using a named include parameter.

This raises a warning:

❯ echo 'glob(["foo.py"])' | buildifier -lint=warn -warnings=+constant-glob -type build -
glob(["foo.py"])
<stdin>:1: constant-glob: Glob pattern "foo.py" has no wildcard ('*'). Constant patterns can be error-prone, move the file outside the glob. (https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#constant-glob)

This fails to raise a warning, even though I'd expect it to:

❯ echo 'glob(include = ["foo.py"])' | buildifier -lint=warn -warnings=+constant-glob -type build -
glob(include = ["foo.py"])
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 a pull request may close this issue.

1 participant