Skip to content

Conversation

@MichalPodeszwa
Copy link

When using the package with IntelliJ's file watcher the console pops up on command errors.
Currently the package returns a 1 exit code when it reformatted at least one file.

This flag adds the possibility to still get 0 after that.

@ambv
Copy link
Collaborator

ambv commented Mar 22, 2018

I worry about adding many options because it makes the tool appear complicated to use. I'll leave this PR open and think a bit more about how we should cover this case. Funnily enough, originally Black wasn't using exit code 1 for changes but somebody asked for it because some other workflow needs it. So your intuition to add an option is probably right. I just need to make sure we end up with an obvious UI for this.

In the mean time, you can work around your issue with "Show console" -> "Never" in "Advanced Options" of your File Watcher.

@eplaut
Copy link

eplaut commented Mar 22, 2018

@ambv I think most of unix utilities are not returning an error exit code if there job been done properly, only for invalid input. IMHO, this should be the default behavior (not just a flag)

@sethmlarson
Copy link
Member

Maybe there should only be an error code when running with --check? That's the only scenario I can think of you'd want an error code (such as running on CI).

@ambv
Copy link
Collaborator

ambv commented Mar 22, 2018

I like Seth's idea to only return 1 if --check is used.

@ambv ambv closed this in 8de552e Mar 23, 2018
@ambv
Copy link
Collaborator

ambv commented Mar 23, 2018

Thank you, @MichalPodeszwa, for you pull request. Sorry we didn't end up merging it this time. I hope this doesn't discourage you from contributing in the future, and more importantly, that our current approach solves your issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants