Skip to content

Commit e85c7ab

Browse files
committed
Warn multimodule users about **/*.md includes
Including '**/*.md' means that all md files in all sub directories are found. In a multi-module maven project, where spotless is run for each module it would mean that markdown files in sub modules are also found by modules at a higher level of the module hierarchie (i.e. sub modules are sub directories of an other module). This means that files would be processed by the formatter multiple times. Which is obviously less performant. Generally, users should be proteced from this, by decent default settings. However, if we would not include '**/*.md' users might be surprised to learn that some of their files are left untouched. Instead, I chose to warn multi-module users specifically about this. Because the impact (and surprise) of not formatting files in nested folder structures is likely greater than the hit in performance due to processing the files multiple times. Also note that the first problem occurs for both regular maven projects as well as multi-module projects and the latter only occurs on multi-module projects.
1 parent 1ef8e60 commit e85c7ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugin-maven/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ All configuration settings are optional, they are described in detail [here](htt
594594
<configuration>
595595
<markdown>
596596
<!-- These are the defaults, you can override if you want -->
597+
<!-- Multi-module users should consider not including **/*.md in modules that contain submodules to make sure files are not formatted multiple times -->
597598
<includes>
598599
<include>*.md</include>
599600
<include>**/*.md</include>

0 commit comments

Comments
 (0)