Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_tuple_trailing_commas-0.1.4.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_tuple_trailing_commas-0.1.4-py3.8.egg (5.6 kB view details)

Uploaded Egg

File details

Details for the file flake8_tuple_trailing_commas-0.1.4.tar.gz.

File metadata

  • Download URL: flake8_tuple_trailing_commas-0.1.4.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for flake8_tuple_trailing_commas-0.1.4.tar.gz
Algorithm Hash digest
SHA256 db1c6174b77f4c19872227646edb0bd7fcff612c2972810276aa5831175bf6d1
MD5 a8d8bc4ef7871f95ab8c92d7db85f000
BLAKE2b-256 83e0fa12e651c34ea052e77eebab85e5c474e250e545fa2ea79e32b90af4c6ca

See more details on using hashes here.

File details

Details for the file flake8_tuple_trailing_commas-0.1.4-py3.8.egg.

File metadata

  • Download URL: flake8_tuple_trailing_commas-0.1.4-py3.8.egg
  • Upload date:
  • Size: 5.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

File hashes

Hashes for flake8_tuple_trailing_commas-0.1.4-py3.8.egg
Algorithm Hash digest
SHA256 c1e5cd2b8098bded3aa2cfdbc5891b3b72994871d9c0c540d4078f07e8f6c1e6
MD5 a92ab050ee6f98faa30dd53357990645
BLAKE2b-256 6d8b5ca8007765c2448daae9fd885048d538e5111e8d7745e2d47a83089f7e3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page