m2lines / gz21_ocean_momentum

Stochastic-Deep Learning Parameterization of Ocean Momentum Forcing
MIT License
5 stars 1 forks source link

Fix the Pylint command in linting CI #69

Closed tztsai closed 1 year ago

tztsai commented 1 year ago

There is an error in the current CI workflow: image

I updated the command from pylint . (which somehow makes pylint look for a __init__.py file in the root directory) to pylint $(find -type f -name *.py), so that it can check all python files in the repository.

Related issue: #16

raehik commented 1 year ago

haha I hadn't looked at that part of the log... >_<

out of curiosity @TZTsai if you know about pytest, can I just send it pytest src/gz21_ocean_momentum and it'll figure out all the *.pys to check? (It works on my machine, but I wonder if there's any difference in behaviour)

tztsai commented 1 year ago

I think for pytest, it only checks all Python files (recursively) with a name starting with "test_"? Besides, isn't there a tests/ folder in the root directory which also should be run by pytest? So I think just pytest . (the current command) would work. Or did you actually mean pylint? I just tried running pylint src/gz21_ocean_momentum but it ignored the python files in folders like "data", "models", "train", etc. because they do not contain a "__init__.py" file.

Update: I just found pylint src/gz21_ocean_momentum/* will also work correctly.

raehik commented 1 year ago

oops, meant pylint & said pytest. Thanks for this!

tztsai commented 1 year ago

oops, meant pylint & said pytest. Thanks for this!

Thanks!