Skip to content

Commit

Permalink
Warn multimodule users about **/*.md includes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
korthout committed Dec 18, 2021
1 parent 1ef8e60 commit e85c7ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugin-maven/README.md
Expand Up @@ -594,6 +594,7 @@ All configuration settings are optional, they are described in detail [here](htt
<configuration>
<markdown>
<!-- These are the defaults, you can override if you want -->
<!-- Multi-module users should consider not including **/*.md in modules that contain submodules to make sure files are not formatted multiple times -->
<includes>
<include>*.md</include>
<include>**/*.md</include>
Expand Down

0 comments on commit e85c7ab

Please sign in to comment.