/flake8-self

private member access linting plugin for flake8

Primary LanguagePythonMIT LicenseMIT

PyPI Anaconda Travis

flake8-self

Private member access linting plugin for flake8.

Example

> pipenv run flake8 example.py
example.py:10:1: SLF001 Private member access
example.py:11:1: SLF001 Private member access

example.py:

class Foo(object):
    def __init__(self):
        self.public_thing = "bar"
        self._private_thing = "quux"
        self.__really_private_thing = "quuz"


foo = Foo()
print(foo.public_thing)
print(foo._private_thing)  # SLF001 Private member access
print(foo.__really_private_thing)  # SLF001 Private member access
print(foo.__dict__)