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
Improve error message for isort failure in IsortRun #7462
Conversation
The isort command is extremely verbose and not very relevant. What really matters are the args used.
This shouldn't be a console task as things stand. I'm almost positive folks install it as a dependency of / directly in the compile goal for example. Any task not being run directly like that should never be a console task. I know this is vague but hopefully makes sense. If it helps, in v2 the console rule would be fmt, the implementations like isort would be plain rules returning result objects encapsulating the report of what they did. The fmt root console rule would print all the aggregate results it received from isort, gofmt, etc. |
Here's a rule for you, if the task is installed in a non-singleton goal in v1 it can't be a console task. |
Bummer, but good to know. Is there any way to not swallow stdout and stderr when using Even if no, hope we can keep this change to make the |
I'm pretty sure there is no canned way. The TaskError improvement stands on its own however. |
Oops. I disagree on the error message. You can actually directly run the prior message. You can't with yours. |
Bummer. Once we close out the blacklist and get Py3 on every CI shard, I'll copy my port of -- Updated error message to keep the whole command. Think this is still an improvement, albeit much smaller scope than originally intended. |
To be clear, the existing message is structured: |
Problem
When
./pants fmt.isort
fails, its failure message is difficult to parse, especially because it starts with the command, rather than human readable English introducing what happened. For example:Solution
Invert the error message to be more readable.
Result
For example: