Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use spotless to enforce style and apply#1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
juherr wants to merge2 commits intojoelittlejohn:master
base:master
Choose a base branch
Loading
fromjuherr:feature/apply-spotless

Conversation

@juherr
Copy link
Contributor

No description provided.

@juherr
Copy link
ContributorAuthor

@ctrimble I’m not sure applying the style all at once is a good idea, but I wanted to show the impact and highlight whether thejsonschema2pojo-eclipse-formatter.xml should be updated to reduce the diff.
Once you’ve confirmed the file is correct, I can drop the commit with the changes and replace it witha gradual check.

@ctrimble
Copy link
Collaborator

@juherr Thanks for submitting this. but it is a distraction right now. I will take a look when the backlog is more in order.

@juherr
Copy link
ContributorAuthor

Sure, it is not urgent

@eirnym
Copy link

I'll add my 2 groszy to the discussion.

Back in the day I've resigned from spotless plugin both at work and in personal projects because it's annoying: you need to hack a solution to test if it works and… you have to format.

Additionally, it take too much time to run, so no rapid development either.

We at work and I in my personal projects usually on commit or even on push (depending on team and project), so pre-commit (or any similar project) checked both locally and on CI works the best.

@juherr
Copy link
ContributorAuthor

@eirnym I didn’t bind the plugin to any Maven phase and added a CI check as you suggested.
I can also add a few words to explain how to run the plugin on a Git event.

That’s exactly what you had in mind, right?

@eirnym
Copy link

I haven't read Spotless for a while now, but AFAIK it binds itself to the build phase like it was back in the day. It's easy to check: just make code less pretty and build the project

@juherr
Copy link
ContributorAuthor

I’ve been using Spotless on many of my projects and haven't run into the issue you mentioned. ;)

@eirnym
Copy link

I've checked documentation and it's not automatic as you've said. But it's a separate non-automated execution which is still not ideal. It's easy to forget run<build> spotless before commit.

It's possible to write a manual pre-commit hook, but it's still not automated.

@juherr
Copy link
ContributorAuthor

@eirnym
Copy link

eirnym commentedSep 8, 2025
edited
Loading

Yes, I did. It's not so easy to manage (keep, install, update) and it's not extensible as pre-commit is.

It's may be ok for a very small project which won't add any other pre commit hooks ever. In teams and in project I work, this tool was replaced with almost direct run of formatters spotless calls.

@eirnym
Copy link

as of specific hooks to use for format, I recommend to look at this one:https://github.com/macisamuele/language-formatters-pre-commit-hooks

@ctrimble
Copy link
Collaborator

As an alternative location to bind this, I have a format lifecycle published. I haven't used it in a while, but we could add anmvn format lifecycle and then bind this plugin to that. That may be a better location for the license header as well. That plugin is always causing me issues with conflicts in my IDE.

@juherr
Copy link
ContributorAuthor

@ctrimble What do you mean exactly?
Are you suggesting creating a custommaven-format-plugin that supports<plugins> in its configuration,
or overriding the default Mavenjar lifecycle by adding a new step to it?

@ctrimble
Copy link
Collaborator

ctrimble commentedOct 17, 2025
edited
Loading

@juherr We could addhttps://github.com/ctrimble/maven-format-lifecycle to the project. Then we would havemvn format from the command line. It just creates a maven lifecycle that has nothing to do with the build.

I haven't messed with that in a few years, but I am not aware of any breaking changes in maven that have broken lifecycle plugins.

juherr reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@juherr@ctrimble@eirnym

[8]ページ先頭

©2009-2025 Movatter.jp