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

[FR]: Pass --aux-classpath to PMD #419

Open
robson-glean opened this issue Oct 24, 2024 · 4 comments
Open

[FR]: Pass --aux-classpath to PMD #419

robson-glean opened this issue Oct 24, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@robson-glean
Copy link

What is the current behavior?

Some lints are not caught correctly because the linter cannot resolve the correct type for all expressions.

Describe the feature

Pass all the jar dependencies for each source file that is being linted through the --aux-classpath flag provided by PMD.

@robson-glean robson-glean added the enhancement New feature or request label Oct 24, 2024
@alexeagle
Copy link
Member

I'm not doing much Java lately - do you have time to contribute a PR that reproduces the issue in the example/ folder here? It's fine if the PR is red, I can make the starlark changes easily. This would save me a bunch of time :)

@robson-glean
Copy link
Author

The issue I'm aware of is only fixed by both migrating to PMD 7 and passing the dependencies correctly. Here's a patch that I believe achieves both.
rules_lint_pmd7.patch

@robson-glean
Copy link
Author

robson-glean commented Oct 29, 2024

An example doesn't fit well with your current examples structure as it needs two files where the first depends on the second. The second needs to be compiled and passed to PMD in its --aux-classpath so that it can detect category/java/errorprone.xml/CompareObjectsWithEquals.

@alexeagle
Copy link
Member

The example does permit multiple files and java_library targets. We already verify graph of typescript targets with eslint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants