pep8-naming
pep8-naming copied to clipboard
Naming Convention checker for Python
These are differences in behavior based on existing and new test cases: statement | before | now -- | -- | -- import os as OS | N812 lowercase 'os'...
For example, this code: ```python import SalesforcePy.commons as sfc ``` fails with: ``` ./test.py:1:2: N813 camelcase 'SalesforcePy.commons' imported as lowercase 'sfc' ``` Shouldn't pep-naming just ~look at the package name...
The built-in base HTTP request handler class in `http.server` asks you to create methods named (for example) `do_GET`, `do_POST`, etc. Rule `N802` warns about these methods.
``` $ cat -n a.py 1 # pylint: disable=missing-class-docstring, missing-module-docstring 2 3 class Foo(type): 4 pass 5 6 7 class Bar(Foo): 8 def __init__(cls): 9 super().__init__() $ flake8 --ignore=D100,D101,D107 a.py...
```python class Key(TypedDict): stepId: str # noqa: N815 ```
Prosed fix for #178 Add specific exemption from N815 for all subclasses of `TypedDict` because class variable naming conventions should not apply to dictionary keys. I've tried to reuse code...
`pep8` implies that constants are named in `UPPER_CASE`: https://www.python.org/dev/peps/pep-0008/#constants Right now this code is considered valid: ```python # Module-level variable: delta = 10 ``` However, it is not valid. This...
member variables are not checked for compliance with naming conventions No warnings are created for improperly named member variables like _self.someVariable_
``` class Aioresponses(type): def __new__(metacls, classname, bases, class_dict): ... ``` This produces: `./tests/unit/test_auth.py:33:18: N804 first argument of a classmethod should be named 'cls'` But, it's a metaclass, and seems to...
PEP 8 suggest some [naming rules for type variables](https://www.python.org/dev/peps/pep-0008/#type-variable-names): > Names of type variables introduced in [PEP 484](https://www.python.org/dev/peps/pep-0484) should normally use CapWords preferring short names: T, AnyStr, Num. It is...