You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Jonathan Valliere <jo...@emoten.com> on 2018/02/19 15:47:05 UTC
Linter / Code Formatting
Any interest in adding support for a linter to automatically check for
formatting / quality issues and formatting the code to enforce consistent
style across the entire codebase?
Re: Linter / Code Formatting
Posted by Jonathan Valliere <jo...@emoten.com>.
I like the idea of CheckStyle because it has an Eclipse Plugin. I can also
add an Eclipse Formatter XML to the project somewhere. The default Eclipse
Formatter does not comply with the Oracle Style Guide.
On Mon, Feb 19, 2018 at 11:47 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:
>
>
> Le 19/02/2018 à 16:47, Jonathan Valliere a écrit :
> > Any interest in adding support for a linter to automatically check for
> > formatting / quality issues and formatting the code to enforce consistent
> > style across the entire codebase?
> >
>
> I would add twi things :
>
> - months ago, I ran the code against Java 8 with the javadoc linter. I
> spent days fixing all the missing Javadoc and incorrect ones. The
> javadoc linter is on by default now on. It's possible to disbale it,
> there is a commented property in the pom.xml file :
>
> ...
> <!-- Make Java 8 javadoc lint to shut the f*** up... -->
> <!-- additionalparam>-Xdoclint:none</additionalparam -->
> ...
>
> - Checkstyle is pretty good at verifying the code format. We don't
> currently use it in MINA, but would we want to set it up, I'll suggest
> we mimic what we did in teh Apache Directory project, where it's on by
> default. It's based on a checkstyle configuration, and a plugin :
>
> https://gitbox.apache.org/repos/asf?p=directory-buildtools.git;a=tree;f=
> checkstyle-configuration;h=67f80df6c18be403fcecd13464b685
> 4bd31eb89e;hb=HEAD
>
> https://gitbox.apache.org/repos/asf?p=directory-ldap-
> api.git;a=blob;f=pom.xml;h=3bfaec9c08bba75ff71b8810bbf092
> d101280d2e;hb=HEAD
>
> with :
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <configuration>
> <failOnViolation>true</failOnViolation>
> <includeTestSourceDirectory>false</includeTestSourceDirectory>
> </configuration>
> <executions>
> <execution>
> <id>validate</id>
> <phase>validate</phase>
> <goals>
> <goal>check</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
>
>
> That works pretty well.
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>
>
Re: Linter / Code Formatting
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 19/02/2018 à 16:47, Jonathan Valliere a écrit :
> Any interest in adding support for a linter to automatically check for
> formatting / quality issues and formatting the code to enforce consistent
> style across the entire codebase?
>
I would add twi things :
- months ago, I ran the code against Java 8 with the javadoc linter. I
spent days fixing all the missing Javadoc and incorrect ones. The
javadoc linter is on by default now on. It's possible to disbale it,
there is a commented property in the pom.xml file :
...
<!-- Make Java 8 javadoc lint to shut the f*** up... -->
<!-- additionalparam>-Xdoclint:none</additionalparam -->
...
- Checkstyle is pretty good at verifying the code format. We don't
currently use it in MINA, but would we want to set it up, I'll suggest
we mimic what we did in teh Apache Directory project, where it's on by
default. It's based on a checkstyle configuration, and a plugin :
https://gitbox.apache.org/repos/asf?p=directory-buildtools.git;a=tree;f=checkstyle-configuration;h=67f80df6c18be403fcecd13464b6854bd31eb89e;hb=HEAD
https://gitbox.apache.org/repos/asf?p=directory-ldap-api.git;a=blob;f=pom.xml;h=3bfaec9c08bba75ff71b8810bbf092d101280d2e;hb=HEAD
with :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
That works pretty well.
--
Emmanuel Lecharny
Symas.com
directory.apache.org
Re: Linter / Code Formatting
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 19/02/2018 à 16:47, Jonathan Valliere a écrit :
> Any interest in adding support for a linter to automatically check for
> formatting / quality issues and formatting the code to enforce consistent
> style across the entire codebase?
We can use Checkstyle for that purpose.
And, yes, that would be a good idea.
For the record, we are following teh standard java convention for the
formatting.
--
Emmanuel Lecharny
Symas.com
directory.apache.org