Howdy,

On Thu, Oct 13, 2022 at 1:55 PM Jeff Jensen <
jeffjen...@upstairstechnology.com> wrote:

> I think reformatting files during every build is less desirable and adds
> risk.  I prefer the build to *enforce* the desired results, failing as
> needed, and configuring the IDEs to auto-format the files on save.  Both
> Eclipse and IntelliJ have many configurable "save actions" for file format
> and cleanup options (e.g. organize imports, remove unused imports, remove
> trailing spaces, add 'final' where possible, convert loops, etc.).
>


This is exactly where we are today. Usually the problems are:
- hard to create "identical" (settings providing 100% same results) for all
IDEs used by devs. Not to mention "minorities", as we provide only Eclipse
and IDEA, what about NetBeans, VSCodium and so on and so on... those people
are really left on their own (manual formatting) that is bad.
- I like to be onboarded as simply as possible: check out sources, and GO.
Not fiddle with my IDE, set up here, add "action" there, tweak elsewhere....

Point is: formatting comes with sources. Moreover, formatting rules are
centralized (in an artifact published to central).


>
> This approach formats files earliest possible (at save time), the developer
> sees the formatting before commit, prevents the build from changing
> non-generated source files (risk), eliminates a build step, and eliminates
> a "new commit of non-developer changed files" issue.
>

Checkstyle already part of build, unsure which step would be eliminated
here? Also, again, comitter, non committer,  they all get SAME formatting,
that's the point.


> The challenge is still everyone using the same formatter settings and
> everyone configuring "save actions"...  Improving the "code style enforcing
> rules" (e.g. Checkstyle) and failing the build will "encourage" developers
> to setup their IDE well for this.
>


That's why proposed PR stores the "formatting setings" an an artifact,
published to central, and due virtue of maven and central, everyone get the
same (100%, not "almost identical") thing.

T

Reply via email to