MarcoGorelli / cython-lint

Lint Cython files
MIT License
69 stars 11 forks source link

ENH Allow to specifiy directory instead of files only #62

Closed jeremiedbb closed 1 year ago

jeremiedbb commented 1 year ago

Currently the command requires to give the list of file paths to check. This PR proposes to allow giving the paths of directories and recursively search for cython files. It allows to do cython-lint . like we're used to with flake8 or black.

It assumes that it should only look for .pyx, .pxd and .pxi files. I don't know if it's safe enough to assume that.

An alternative I considered was to allow for a glob pattern instead of a directory. The advantage is that it delegates the responsibilty of the suffix to the user (but requires 1 pattern for each suffix). The disadvantage is that it can be a pain for windows users.

MarcoGorelli commented 1 year ago

thanks for your PR!

If we want to allow this, then we probably also need --files and --exclude arguments

I'll add a commit

MarcoGorelli commented 1 year ago

cool, added (mirroring what I already do, and have tested, in nbQA)

MarcoGorelli commented 1 year ago

@jeremiedbb version 0.13.0 should have this feature, please do let me know if it doesn't work for you!

jeremiedbb commented 1 year ago

Thanks @MarcoGorelli, I just tested it and it works as expected !