flake8 plugin for enforcing few rules
Project description
Description
This flake8 plugin enforces trailing commas in tuples and do few other things. It hasn't settings so far. In near future it will be renamed.
New error messages:
- CMA100 trailing comma in tuple is missing
Examples
Code below is invalid:
a = (
1, 2, 3
)
And this is a valid version:
a = (
1, 2, 3,
)
- CMA200 message of ValidationError should end with dot
Enforces ValidationError (both rest_framework and django) to have dot in the end of message/messages:
Invalid:
raise ValidationError(_('Error without dot'))
Valid
raise ValidationError(_('Error with dot.'))
- CMA201 message of ValidationError should be wrapped in
_
Enforces all messages of ValidationError to be wrapped in call of function _ (it could be gettext or gettext_lazy)
Invalid
raise ValidationError('Not internationalized')
Valid
raise ValidationError(_('Internationalized'))
Known bugs
- CMA100 incorrectly handles return/yield with multiple parameters
- CMA201 can't handle case of error message, defined outside ValidationError yet
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
Built Distributions
Close
Hashes for flake8_tuple_trailing_commas-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5bf7e04e79603ca652ee62042b27f91ae8b8ec434f947171d52dceb829a89c |
|
MD5 | d76640fd90c51e7a9d5ff5280ae7e583 |
|
BLAKE2b-256 | 7ca43a75246759eaf4a4d6e1567988fa8bdc3cd11fa4768a04881620da0c4090 |
Close
Hashes for flake8_tuple_trailing_commas-0.1.3-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc35f13399820097a6bbac0de7749c03bf61f91abf3cb7464628c211739f65a9 |
|
MD5 | cb3a2ca237208eb7327e103d4cae6dec |
|
BLAKE2b-256 | 3d6a660c816d6376f289887aa48ac80bc835f2ef7ad7a377a7e4cd3d529245fc |
Close
Hashes for flake8_tuple_trailing_commas-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cea89c607b61aa697c0f075a312642278a9efa50e6670bb5670ff0cb33f2457c |
|
MD5 | 96c909643c4c9add2c0bb89589756b45 |
|
BLAKE2b-256 | e62065e2abcbdaeba352a8a4ebdc3c7e9318b433ab5419381161adc5f8dcab18 |