rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.83k stars 855 forks source link

make isort black compatible #930

Closed rasbt closed 2 years ago

labdmitriy commented 2 years ago

Could you please tell is isort/black working ok with this configuration? I thought that we need --check (for black) and --check-only (for isort) arguments to return corresponding codes which GitHub Action will use for decision? I saw that both official GitHub Actions for it use these arguments (along with --diff argument).

Description:

rasbt commented 2 years ago

Thanks for the note! I thought --check would be redundant if we use --diff but that was not the case. Just tested and updated it.

labdmitriy commented 2 years ago

Probably you are tired of my notes, but isort as I understand uses check-only, not check option :)

rasbt commented 2 years ago

No worries, I actually find your comments super helpful! It looks like both check and check-only do the same. My gut feeling is that it used to be check-only but they also added check for consistency with other tools.

From isort --help:

  --show-files          See the files isort will be run against with the current config options.
  --df, --diff          Prints a diff of all the changes isort would make to a file, instead of changing it in
                        place
  -c, --check-only, --check
                        Checks the file for unsorted / unformatted imports and prints them to the command line
                        without modifying the file. Returns 0 when nothing would change and returns 1 when the
                        file would be reformatted.
  --ws, --ignore-whitespace
                        Tells isort to ignore whitespace differences when --check-only is being used.
labdmitriy commented 2 years ago

No worries, I actually find your comments super helpful! It looks like both check and check-only do the same. My gut feeling is that it used to be check-only but they also added check for consistency with other tools.

From isort --help:

  --show-files          See the files isort will be run against with the current config options.
  --df, --diff          Prints a diff of all the changes isort would make to a file, instead of changing it in
                        place
  -c, --check-only, --check
                        Checks the file for unsorted / unformatted imports and prints them to the command line
                        without modifying the file. Returns 0 when nothing would change and returns 1 when the
                        file would be reformatted.
  --ws, --ignore-whitespace
                        Tells isort to ignore whitespace differences when --check-only is being used.

Ah sorry, you are right! Thank you.