Set of flake8 plugins designed for Level 12 internal use.
This package is not currently published on PyPI, so the more direct git ref is needed:
pip install git+https://github.com/level12/flake8-level12.git
As with other flake8 plugins, when this module is installed in a virtual environment, the plugins will be enabled and can be selected/ignored the same way other codes are.
Note: if you have your project set up to check flake8 in tox, be sure to include this package in that test environment's deps
.
- mock_autospec
- The following patching usages are covered:
mock.patch
,mock.patch.object
, andmock.patch.multiple
- usage as class/method decorator, or as a context manager
- M100: autospec keyword arg missing
- M101: autospec keyword should be True
- M102: spec_set keyword arg missing
- M103: spec_set keyword should be True
- The following patching usages are covered:
To develop on flake8-level12, begin by running our tests:
git clone https://github.com/level12/flake8-level12 flake8-level12
cd flake8-level12
tox
As an alternative to using tox
, you may run pytest
from within your own virtual environment:
pip install -e .[test]
pytest
Each plugin in this package should have tests: pytest
is used as the test runner.
- create plugin module in
flake8_level12
- plugin class must have
name
andversion
attributes version
may be imported fromflake8_level12.version
- plugin class must have
- add tests in the
tests
folder - add the plugin definition to
setup.py
as described in flake8 docs