Pylint plugin to help automate code reviews and complying with quality standards.
Project description
pylint-comply
Pylint plugin to help automate code reviews and complying with quality standards.
Installation
Install the module with e.g. poetry add --group dev pylint-comply
.
Usage
In your Pylint configuration (e.g. in pyproject.toml
) add the following:
[tool.pylint.MAIN]
load-plugins = "pylint_comply"
Import restrictions
Once the plugin is enabled, in your Pylint configuration (e.g. in pyproject.toml
) add the following:
[tool.pylint.MAIN]
import-restriction = [
"module_visited->module_import_restriction",
"module2_visited -> restriction\\..*"
]
The restrictions configured as part of import-restriction
setting, and as represented above take the following shape - module_visited -> import_restriction
module_visited
: The module which is presently being looked at. This could be a RegEx in order to capture several modules.->
: The separator denoting the module being investigated (on the left), and the restricted imports (on the right). You can optionally add spaces around it for clarity.import_restriction
: The module which is restricted from being imported within the module being investigated. This could be a RegEx in order to capture several modules.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylint_comply-0.1.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for pylint_comply-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27f443c0b253d4dd70985f6acc777f1ddcc57306ec787120f8107f3d1cf36b89 |
|
MD5 | a6171cffa96b73854770efc240ccf286 |
|
BLAKE2b-256 | d7bbce8eb9c98152c8cfc019b775d967b0b43db9e9f3a316e463600e2fe64707 |