Page MenuHomePhabricator

Add Java linters, checkstyle and PMD
Open, Needs TriagePublic

Description

The checkstyle utility (http://checkstyle.sourceforge.net/) is a common tool for linting coding standards. It comes with configurations to support two coding standards (Sun's and Google's), however customized coding standards can be configured through XML file. The CLI supports a basic XML report over stdout which fits nicely with arcanist's lint engine structure.

The PMD utility (https://pmd.github.io/) is another tool for linting general java errors, as well as having the ability to detect copy/pasted code. The CLI also supports basic XML report over stdout which can feed into arcanist's lint engine.

Revisions and Commits

Event Timeline

cspeckmim claimed this task.
cspeckmim updated the task description. (Show Details)
cspeckmim added projects: Lint, Arcanist.
cspeckmim added a subscriber: cspeckmim.
cspeckmim renamed this task from Add checkstyle for Java linting to Add linters for Java.Dec 8 2015, 7:23 AM
cspeckmim updated the task description. (Show Details)
cspeckmim renamed this task from Add linters for Java to Add Java linters, checkstyle and PMD.Jan 2 2016, 1:23 AM

I renamed the task to indicate specifically which linters are being asked for, so as not to just request generic "Java" ones. Initially this task was just for checkstyle, but after I got it working in D14632 I decided to give PMD a shot as well. In hindsight it probably would have been beneficial to keep them separate, though there is a dependency on some changes in order to get a java jar to run as a linter. Let me know if you prefer them to be separated to different revisions/tasks.

eadler added a project: Restricted Project.Jan 11 2016, 9:39 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jan 11 2016, 9:42 PM

I thought FindBugs required analysis of the .class files which I didn't think would make useful for linting, but perhaps as UT or something?

It does require .class files - I run it in the CI along with the tests (And PMD).

A lot of Java tools require .class files :-/

I've been avoiding those tools as compiling our project for .class files requires a lengthy amount of time, which would be better integrated into our jenkins test runners.

eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 4 2016, 9:10 PM