pep8-naming
pep8-naming copied to clipboard
Filename checks?
Modules should have short, all-lowercase names.
pycodestyle could check the passed filenames are lowercase to help enforce this.
(Apologies if this isn't new, I couldn't find any existing issue but there are quite a few terms to search/filter so might have missed one)
Except that sometimes things are passed on standard in and many modules use _
these days which sounds like it's against the PEP. So I'd say the de facto standard is quite different from the written standard.
this may be something better accomplished through pep8-naming?
@sigmavirus24 _
is not against the PEP, sorry the full text is:
Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
pycodestyle could only check for uppercase characters. These cause problems porting code from a case insensitive to case sensitive filesystem, and the main reason I opened this issue.
I appreciate the name can't be checked from stdin.
@asottile Yes it could be in that project instead.
I transferred this over to pep8-naming since we were all in agreement about where it belonged.
JFYI: a lot of module-level checks are covered in wemake-python-styleguide
that uses pep8-naming
as a dependency.
There are also two flake8 plugins that are related to this feature, but it will be nice to have it in pep8-naming:
- flake8-module-name. A flake8 plugin for testing PEP-8 conform package and module names.
- flake8-filename. A flake8 linter plug-in for validating that certain files comply with a user defined pattern.
flake8-filename
says
This project is currently not actively maintained