rickstaa / action-black

Runs the psf/black formatter to check/format your python code.
https://github.com/marketplace/actions/run-black-formatter
MIT License
38 stars 12 forks source link

Difference with the official 'psf/black@stable' action #10

Open rickstaa opened 2 years ago

rickstaa commented 2 years ago

Now that https://github.com/psf/black/pull/1909 and https://github.com/psf/black/pull/1940 have been merged this action is not trivial anymore. Below I, therefore, documented the difference between this action and the official black action.

ricks/action-black psf/black
Action type docker composite
fail_on_error argument
is_formatted output var
specify black version
LLyaudet commented 5 months ago

Hello, Re What is the goal of the feature fail_on_error ? By default, psf/black will return the error code of black process unmodified https://github.com/psf/black/blob/e7fb048281a83733f0b162fc7fa85e48044ea9ec/action/main.py#L181. And by default you will not return an error code https://github.com/rickstaa/action-black/blob/b1c43752f86fe75a86904bb2feeea8661c58a017/entrypoint.sh#L95C1-L97C3. But you can simply ignore return code in calling context. You need less than one or two hours to make the code, test it and submit a PR. Since I'm slightly paranoïd, it appears to me like bread crumbs for someone else to add a pull request that hides error codes by default. But I may be wrong. Best regards, Laurent Lyaudet