sevntu-checkstyle/sevntu.checkstyle — pull request #206 by tsjensen (2014-08-26 08:27:09+00:00)
Title: New check 'RegexpOnFilename'

Here is a new check called 'RegexpOnFilename', which applies a given regular expression to the names of files (path and file name, not the file contents). Depending on the configuration, a warning is logged if a required match is not found, or if an illegal match is found.

This is useful for situations such as:

* Checking that resources in certain directories follow a naming convention
* Resource file names contain only legal characters
* Files of certain types are created in the right places, e.g. Java files under src/*/java
* Prevent certain files or types of files altogether, by "banning" their names
* The default action is to flag leading or trailing spaces in file names.

Side note: This check does not make use of the file contents or the AST. So I believe it is "low risk" when it comes to testing. I still provided unit tests with 100% branch coverage. Maybe this will make it easier to promote this check to the main Checkstyle tool. I maintain a feature branch in my main Checkstyle fork, so I can create a pull request as soon as you say the word (including xdocs).