This Flake8 plugin for checking that first param of callable is simple string.
Project description
flake8-simple-string-first-arg
This Flake8 plugin for checking that first param of callable object is simple string. Plugin will check for specified callable objects that it is not allowed to use f-sting, .format method, string concat and % statement for first parameter
Quick Start Guide
-
Install
flake8-simple-string-first-arg
from PyPI with pip:pip install flake8-simple-string-first-arg
-
Configure a mark that you would like to validate:
cd project_root/ vi setup.cfg
-
Add to file following:
[flake8] simple-string-first-arg = SomeClassName, OtherClassName:url
-
Run flake8::
flake8 .
flake8 codes
- SFA100: In calling {CallableName} f-string is used
- SFA200: In calling {CallableName} string.format() is used
- SFA300: In calling {CallableName} string concatenation ("+") is used
- SFA400: In calling {CallableName} "%" is used
Settings
simple-string-first-arg
It specifies a list of name of callable objects, that should have simple string as first arg.
You can add the name of the argument via :
to check if it is passed as a named parameter.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flake8_simple_string_first_arg-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887baee6a8bd223e6dec60606cbfabfce0840db395f171d62551c72740215103 |
|
MD5 | ef3f15318da2d915e0164a90c99cef62 |
|
BLAKE2b-256 | 3b34d286cf25ca75c1d2182c36a0c08f58cc8c2568a8e3d1ba1abca6b9f98ccd |
Hashes for flake8_simple_string_first_arg-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2315e79636dc3ec84c7027934c7ca88595218d642a87686a36a9e363a53041c2 |
|
MD5 | 7df9e70428363724530a6073c7947d53 |
|
BLAKE2b-256 | 45d7c55592ca2b1f265f6b41b3ee656f29cd17e57d60bc21e9d706bead8e65ca |