ESSS / esss_fix_format

Simple code formatter and pre-commit checker used internally by ESSS
MIT License
19 stars 10 forks source link

v1.8.0 - Ignore Python files generated by Jupytext #39

Closed danilomendesdias closed 5 years ago

danilomendesdias commented 5 years ago

We are trying https://github.com/mwouts/jupytext and automatic generated python files from jupytext are not compatible with esss_fix_format.

This is an attempt to ignore files with the following pattern:

1) [BASE-NAME].py and [BASE-NAME].ipynb exist in the same folder 2) "jupytext" is found on [BASE-NAME].ipynb content, which gives a clue that it has "jupytext" on its metadata.

I know that 2) is not THAT good, so suggestions are welcome.

tadeu commented 5 years ago

Looks good! It would be nice if it showed something like (skipped: jupytext) for these files, just to make it clear that they are being skipped.

danilomendesdias commented 5 years ago

@tadeu thanks for the tip. Actually it was warning with a wrong message ('Unknown file type'), I generalized should_format in order to have a reason message, which now includes also 'Jupytext generated file'. Take a look again, please.