feat(lint): add scalafix linter#914
Conversation
ec4584b to
c23503e
Compare
| bazel_dep(name = "rules_shell", version = "0.5.0") | ||
| bazel_dep(name = "rules_java", version = "7.0.6") | ||
| bazel_dep(name = "rules_cc", version = "0.2.0") | ||
| bazel_dep(name = "rules_scala", version = "7.1.6") |
There was a problem hiding this comment.
I don't want to add any new deps here as this now effects the module versions of any rules_lint user such as pulling in rules_java - who cares if the rules_lint user doesn't use it, but a rules_lint user might not want rules_java being bumped due to a linter.
I'm proposing any lint tools that require a bazel_dep (other then maybe skylib or bazel-lib) live in their own MODULE. See the new aspect_rules_lint_rust MODULE for the first example - that one is now published to BCR and everything.
In rules_lint v3 I'm proposing everything move out of this root MODULE, for now I just want to avoid adding new ones.
There was a problem hiding this comment.
Thanks for the review @jbedard.
I've moved the scalafix linter into a new module aspect_rules_lint_scala and updated the example code.
Note that this PR still requires changes to the SARIF processor in rules_lint, so the flow here has to be: publish a new rules_lint release with the changes, bump the minimum rules_lint version for scala, and then publish the new aspect_rules_lint_scala release. Let me know if that sounds right to you.
6bc3287 to
394d756
Compare
|
The CI failure for CI - Vanilla Bazel / integration-test (examples/scala) (pull_request) looks like an infra / repo setup issue. |
394d756 to
fb8e6d2
Compare
Add a scalafix linter aspect with semanticdb bundling support, diff-based SARIF handling, and updates to the scala example + lint task usage.
7a44f4c to
966a1f4
Compare
|
CI is green now. @jbedard, would you mind taking a look? |
966a1f4 to
cb281bc
Compare
Supports Scalafix as a linter for Scala code. Scalafix is a refactoring and linting tool from Scala Center that supports both syntactic and semantic code analysis.
Scalafix produces lint diagnostics and rewrite patches for configured rules.
This aspect supports the built-in syntactic and semantic rules. We can amend it in the future to support custom plugins, but I have not yet had a need for this.
Notes:
Changes are visible to end-users: yes
Suggested Release Notes
Scala targets can not be linted using scalafix.
Test plan