-
Notifications
You must be signed in to change notification settings - Fork 61
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
FR: Test rule for running google-java-format check #23
Comments
If we can expose the Google Format command as a |
I still don't get how As mentioned in this comment: google/google-java-format#917 (comment) it would only work for a project with one single source Bazel package, e.g.: genrule(
name = "gjf-check-invocation",
srcs = glob(["src/main/java/**/*.java"]),
cmd = "find . -name \"*.java\" | xargs $(location :gjf-binary) --dry-run > $@",
tools = [":gjf-binary"],
outs = ["check-java-format.log"],
)
sh_test(
name = "gjf-check",
srcs = [":gjf-check-invocation"],
tags = ["oauth"],
) Gerrit Code Review project has (atm) 168 different Bazel packages:
That means Just re-reading your comment:
We would have to delegate |
https://github.com/aspect-build/rules_lint supports Although I have not personally used |
Currently we are doing this outside of the build, e.g. with this alias:
On Slack @shs96c commented how this test rule could be implemented:
Update
Linting can be disabled by adding a
no-lint
tag to any rule that needs it.And for everything in a build file by using
package_lint_config(linters = {})
.It was also pointed out, that there is another PR was uploaded upstream.
The text was updated successfully, but these errors were encountered: