Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip parameter to AbstractSpotlessMojo #366

Closed
rmannibucau opened this issue Mar 6, 2019 · 6 comments
Closed

Add skip parameter to AbstractSpotlessMojo #366

rmannibucau opened this issue Mar 6, 2019 · 6 comments
Labels

Comments

@rmannibucau
Copy link
Contributor

Hi,

I have a build with spotless:apply active by default to enforce the formatting but I'd like to be able to bypass it in some cases, can you add a skip parameter to the apply mojo or the parent abstract mojo please?

Thanks,
Romain

@nedtwigg
Copy link
Member

nedtwigg commented Mar 6, 2019

I have a build with spotless:apply active by default

I think this is probably a mistake. This means that your commit history is likely to include formatting errors, but spotless won't warn you. This is because you will commit a formatting error, but your CI will fix it before it runs the check, and tell you that everything is fine.

See: #79 (comment)

@nedtwigg nedtwigg closed this as completed Mar 6, 2019
@rmannibucau
Copy link
Contributor Author

rmannibucau commented Mar 6, 2019

Hi @nedtwigg,

No this is intended - I went from a simple check but it was a too bad flow for us - and it works fine.

It can be that a commit includes a formatting like you describe but we have the same kind of things for doc so this issue is better than using check which was always failling due to diverse IDE setups.

Overall speeding up apply is what i would like, skip is trivial to do but if check is fast enough, skipping apply when check succeeds can work too.

@nedtwigg
Copy link
Member

nedtwigg commented Mar 6, 2019

check which was always failling due to diverse IDE setups

That means that your commit history is dirty with formatting changes. That's not a big deal, perfectly reasonable to say "we don't care if history has formatting changes", in which case you should disable spotless:check, and then spotless is just a voluntary thing your developers can tinker with if they want to.

If you're going to always run apply, then don't run check. It's the same result - CI doesn't care about formatting errors. The difference is that one is much faster than the other.

@rmannibucau
Copy link
Contributor Author

I never run check but i cant skip apply which is my issue.

@nedtwigg
Copy link
Member

nedtwigg commented Mar 6, 2019

By default, spotless adds check to the verify phase. You can disable it like this. Spotless does not run apply by default. If it is running apply, that's because you have configured it that way.

It's possible I'm misunderstanding something, in which case I sincerely apologize for my mistake, but I think I've said everything I can on this topic. This project has 21 other watchers besides me, perhaps one of them will be able to help. If you're still unsatisfied with my response, I would recommend explaining your problem to a colleague, to see if they can read this thread and explain to me where my misunderstanding is. I'll read future replies to this, but as stated before, this is probably my last response.

@rmannibucau
Copy link
Contributor Author

Well not sure what is unclear but let me try to rephrase it one last time: i want a spotless.apply.skip property in apply mojo. Then it matches the setup we decided to use and my dev workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants