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

Added plugins to run Checkstyle and generate reports #3516

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

ajaychandran
Copy link
Contributor

@ajaychandran ajaychandran commented Sep 11, 2024

Added plugins

  • CheckstyleModule, fully compliant with Checkstyle CLI
  • CheckstyleXsltModule, generates reports by applying XSL Transformations on a Checkstyle output report

Resolves #3332.

@ajaychandran
Copy link
Contributor Author

ajaychandran commented Sep 11, 2024

Pending
On running mill.contrib.checkstyle.CheckstyleModuleTest.arguments.stdout, the Checkout output report is not printed to the console.

-------------------------------- Running Tests --------------------------------
mill.testkit.UnitTester: [8/8] checkstyle 
mill.testkit.UnitTester: running checkstyle ...
Checkstyle ends with 4 errors.
mill.testkit.UnitTester: checkstyle found 4 violation(s)
+ mill.contrib.checkstyle.CheckstyleModuleTest.arguments.stdout  

I suspect this is an environment issue. Will investigate further.

@ajaychandran
Copy link
Contributor Author

@lihaoyi Please review.

* }}}
*/
def checkstyleXsltReports: T[Set[CheckstyleXsltReport]] = T {
val dir = millSourcePath / "checkstyle-xslt"
Copy link
Member

Choose a reason for hiding this comment

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

This should be moved into a T.source task to ensure changes to that upstream folder properly invalidate this downstream target

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove CheckstyleXsltReport and replace checkstyleXsltReports with

def checkstyleXslt: T[Seq[PathRef]] = T.sources { ??? }

def checkstyleXsltOutput: T[Seq[PathRef]] = T { ??? }

I can submit a PR. Let me know.

Copy link
Member

Choose a reason for hiding this comment

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

no worries, I already opened on #3522

@lihaoyi lihaoyi mentioned this pull request Sep 12, 2024
@lihaoyi
Copy link
Member

lihaoyi commented Sep 12, 2024

I think this looks good, if you're happy with it I'll merge it. Another CheckStyle PR has been submitted that has also been of great help understanding the solution space (#3472), so I'll pay out 70% of the bounty for this one and 30% of the bounty for the other. @ajaychandran email me your bank transfer details and I'll wire it over

@lihaoyi lihaoyi merged commit a02a3c6 into com-lihaoyi:main Sep 12, 2024
23 checks passed
@ajaychandran
Copy link
Contributor Author

@lihaoyi Thank you for the guidance.

@ajaychandran ajaychandran deleted the checkstyle branch September 12, 2024 01:34
@lefou lefou added this to the 0.12.0 milestone Sep 12, 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.

Add Java Checkstyle Plugin (1000USD Bounty)
3 participants