Proposal: source-fixes-maven-plugin

15 views
Skip to first unread message

Jochen Wiedmann

unread,
Feb 17, 2021, 6:17:09 PM2/17/21
to mojoha...@googlegroups.com
Hi,

what is our stance with regard to new plugins? Because, I'd like to propose one:

The source-fixes-maven-plugin (Suggestions for a better name quite welcome.)
is kind of companion to the checkstyle-maven-plugin.
If there are issues, that the latter detects, and that can be fixed
automatically, then
the former will do just that. Examples:

- Replace leading spaces with tabs, or vice versa.
- Replace CRLF with LF, or vice versa.
- Remove trailing blanks.

Background: Working on commons-lang, I notice that I spend more time
fixing Checkstyle issues like the above than doing the actual work.

Jochen


--

Look, that's why there's rules, understand? So that you think before
you break 'em.

-- (Terry Pratchett, Thief of Time)

Falko Modler

unread,
Feb 17, 2021, 6:39:09 PM2/17/21
to mojoha...@googlegroups.com
Hi Jochen,

https://github.com/revelc/formatter-maven-plugin seems to support
already the things you've listed.

Cheers,
Falko

Ben M.

unread,
Feb 18, 2021, 3:00:28 AM2/18/21
to mojohaus-dev
Hey,

I think the checkstyle team is working on sth similar.
The plugins "spotless" and "formatter" have limitations themselves. I was not able to get them working properly in every edge case (i.e. additional file types like groovy, xml, etc.).

Andreas Sewe

unread,
Feb 28, 2021, 12:05:07 PM2/28/21
to mojoha...@googlegroups.com
Hi Jochen,

> what is our stance with regard to new plugins? Because, I'd like to propose one:
>
> The source-fixes-maven-plugin (Suggestions for a better name quite welcome.)
> is kind of companion to the checkstyle-maven-plugin.
> If there are issues, that the latter detects, and that can be fixed
> automatically, then
> the former will do just that. Examples:
>
> - Replace leading spaces with tabs, or vice versa.
> - Replace CRLF with LF, or vice versa.
> - Remove trailing blanks.

if you are using an .editorconfig, then the editorconfig-maven-plugin's
format goal [1] should be able to accomplish this, at least for the
three properties you've listed above [2]. Hope this helps.

Best wishes,

Andreas

[1] <https://ec4j.github.io/editorconfig-maven-plugin/format-mojo.html>
[2] <https://github.com/ec4j/editorconfig-maven-plugin#how-it-works>

signature.asc
Reply all
Reply to author
Forward
0 new messages