-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Describe the bug
We're currently getting a WARN-level log line when one of the Maven modules doesn't have a tests directory.
The code responsible for this:
fmt-maven-plugin/src/main/java/com/spotify/fmt/AbstractFMT.java
Lines 104 to 108 in 1cf19c0
| if (testSourceDirectory.exists() && !skipTestSourceDirectory) { | |
| directoriesToFormat.add(testSourceDirectory); | |
| } else { | |
| handleMissingDirectory("Test source", testSourceDirectory); | |
| } |
fmt-maven-plugin/src/main/java/com/spotify/fmt/AbstractFMT.java
Lines 184 to 198 in 1cf19c0
| private void handleMissingDirectory(String directoryDisplayName, File directory) | |
| throws MojoFailureException { | |
| if (failOnUnknownFolder) { | |
| String message = | |
| directoryDisplayName | |
| + " directory '" | |
| + directory | |
| + "' does not exist, failing build (failOnUnknownFolder is true)."; | |
| getLog().error(message); | |
| throw new MojoFailureException(message); | |
| } else { | |
| getLog() | |
| .warn(directoryDisplayName + " directory '" + directory + "' does not exist, ignoring."); | |
| } | |
| } |
It looks like it will WARN you of a missing directory even if you explicitly excluded that directory from being checked (even if it does in fact exist).
To me it feels like this is the kind of information that deserves to be logged but at a INFO level, otherwise it leads to 'warning fatigue' because most of the time this isn't something that people will act on and it's also not possible to disable.