Closed apletnev closed 4 years ago
Merging #31 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #31 +/- ##
=========================================
Coverage 63.88% 63.88%
Complexity 7 7
=========================================
Files 7 7
Lines 36 36
Branches 1 1
=========================================
Hits 23 23
Misses 13 13
@apletnev why do we need this formatter as a lib dependency? Shouldn't we include a plugin instead to run it during maven phases?
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
Or am I missing something?
@msashkin There are few solutions. First, you add a plugin into your IDE, and it formats the code. Second, if you don't use the plugin, a build system must notify you of incorrect styles. Unfortunately, I added the incorrect plugin, that plugin can automatically replace incorrect code with correct one, but it doesn't notify us that the code style is wrong.
@apletnev my point is that you added this formatter as a library dependency, not a plugin one. Thus, the only way you can use it is by calling its methods directly from the Java code, i.e:
String formattedSource = new Formatter().formatSource(sourceString);
There is no point for us to do that, because we do not generate code.
Instead of this, in my opinion, we should add a plugin dependency, i.e. https://github.com/coveooss/fmt-maven-plugin + Idea plugin
Resolves #30
Description
Testing Details