wemake-python-styleguide

Open source

The strictest and most opinionated python linter ever!

Become a contributor

Financial contributions

Custom contribution

Donation

Make a custom one time or recurring contribution to support this collective.
+ 10

9 individuals and 4 organizations have contributed

One time contribution

Say "Thanks!"

If you benefit from wemake-python-styleguide, say thanks to the developers! This is a one-time d... Read more

Starts at

$5 USD

+ 7

8 individuals and 2 organizations have contributed

Membership

Bronze sponsor

This is a base plan for a company to sponsor wemake-python-styleguide development. You will be l... Read more

$100 USD / month

1 organization has contributed

Membership

Silver sponsor

This is an advanced plan for a company to sponsor wemake-python-styleguide development. You will... Read more

$500 USD / month

Membership

Gold sponsor

This is a Golden plan for a company to sponsor wemake-python-styleguide development. 1. You will... Read more

$1,000 USD / month

Top financial contributors

Individuals

1

Chaim Krause

$10 USD since Jan 2020

2

Matthew Emery

$10 USD since Mar 2020

3

Marco Roose

$10 USD since Mar 2020

4

Nikita Sobolev

$5 USD since Jul 2019

5

Valentin Dombrovsky

$5 USD since Jul 2019

6

Artem Malyshev

$5 USD since Jul 2019

7

Kirill

$5 USD since Jul 2019

8

Artem B

$5 USD since Aug 2019

9

Ellina Morits

$5 USD since Nov 2019

Organizations

1

PJSC "Rostelecom"

$900 USD since Aug 2019

2

MoscowPython

$5 USD since Jul 2019

3

Drylabs

$5 USD since Jul 2019

4

git-secret

$5 USD since Nov 2019

5

dry-python

$5 USD since Mar 2020

What's new with wemake-python-styleguide

Stay up to dates with our latest activities and progress.

Version 0.14.0 aka The Walrus fighter

This release was focused on adding python3.8 support, removing dependencies that can be removed, and fixing bugs.

There are breaking changes ahead!

We also have this 0.14 migration guide.

Features

  • Breaking: removes flake8-executable, now using WPS452 instead of EXE001..EXE005
  • Breaking: removes flake8-print, now using WPS421 instead of T001
  • Breaking: removes flake8-builtins, now using WPS125 instead of A001..A005
  • Breaking: removes flake8-annotations-complexity, now using WPS234 instead of TAE002
  • Breaking: removes flake8-pep3101, now using WPS323 instead of S001, we also use a new logic for this violation: we check string defs for % patterns, and not for % operator
  • Breaking: WPS441 is no longer triggered for except blocks, it is now handled by F821 from flake8
  • Breaking: removes radon, because cognitive-complexity and mccabe is enough
  • Breaking: removes flake8-loggin-format as a direct dependency
  • Breaking: removes ImplicitTernaryViolation or WPS332, because it has too many false positives #1099
  • Removes flake8-coding, all encoding strings, visitor and tests for old WPS323 which is now reused for modulo formatting checks
  • Adds python3.8 support
  • Changes styleguide.toml and flake8.toml scripts definition
  • Extracts new violation - WPS450 from WPS436 #1118
  • Adds domain names options: --allowed-domain-names and --forbidden-domain-names, that are used to create variable names' blacklist #1106
  • Forbids to use \r (carriage return) as line breaks in strings #1111
  • Forbids to use := operator, it now reuses WPS332 code
  • Forbids to use positional only / arguments
  • Forbids to have too many names imported from a single from ... import
  • Forbids to use continue and break in finally
  • Forbids to use __reduce__ and __reduce_ex__ magic methods
  • Adds __call__ to list of methods that should be on top #1125
  • Allows _ to be now used as a defined variable
  • Removes cognitive_complexity dependency, now it is built in into our linter
  • Adds baseline information for all complexity violation messages: x > baseline
  • Changes how cognitive complexity is calculated
  • Adds support for positional arguments in different checks
  • Adds UnreadableNameViolation as WPS124 because there are some character combination which is not easy to read
  • Adds support for NamedExpr with in compare type violation

Bugfixes

  • Fixes how i_control_code behaves with WPS113
  • Fixes that cognitive complexity was ignoring ast.Continue, ast.Break, and ast.Raise statements
  • Fixes that cognitive complexity was ignoring ast.AsyncFor loops
  • Fixes that annotation complexity was not reported for async functions
  • Fixes that annotation complexity was not reported for lists
  • Fixes that annotation complexity was not reported for * and / args
  • Fixes that annotation complexity was not tested for dot notation attributes
  • Fixes that annotation complexity fails on string expressions
  • Fixes bug when TooManyPublicAttributesViolation was counting duplicate fields
  • Fixes negated conditions WPS504 was not reported for if expressions
  • Fixes that import dumps was reported as WPS347, now only from ... import dumps is checked
  • Fixes that from some import a as std was reported as a vague import with WPS347 despite having a meaningful alias
  • Fixes that WPS501 was reported for @contextmanager definition
  • Fixes WPS226 to be thrown at nested string type annotations
  • Fixes WPS204 reported simplest nodes as overused like [] and call()
  • Fixes WPS204 not reporting overused f strings
  • Fixes WPS204 reporting overused return type annotations
  • Fixes WPS204 reporting self. attribute access
  • Fixes WPS331 reporting cases that do require some extra steps before return
  • Fixes WPS612 not reporing super() calls without return
  • Fixes WPS404 not raising on wrong * and / defaults
  • Fixes WPS425 raising on .get, getattr, setattr, and other builtin functions without keyword arguments
  • Fixes WPS221 reporting differently on different python versions
  • Fixes WPS221 reporting nested variable annotations
  • Fixes WPS509 not reporting nested ternary in grandchildren of if
  • Fixes WPS509 not reporting nested ternary in ternary
  • Fixes WPS426 not reporting nested lambda in comprehensions
  • Fixes several violations to reporting for ast.Bytes and ast.FormattedStr where ast.Str was checked
  • Fixes WPS601 reporting shadowing for non-self attributes
  • Fixes WPS114 not to be so strict
  • Fixes WPS122 not raising for for and async for definitions
  • Fixes WPS400 raising for # type: ignore[override] comments
  • Fixes WPS115 not raising for attributes inside other nodes

Misc

  • Changes how tests are executed
  • Changes how coverage is calculated, adds coverage-conditional-plugin
  • Adds how a violation can be deprecated
  • Improves old visitor tests with / argument cases
  • Improves old visitor tests with := cases
  • Adds local-partial-types to mypy config
  • Uses abc stdlib's module to mark abstract base classes #1122
  • Adds python3.8 to the CI
  • Updates a lot of dependencies
Published on March 25, 2020 by Nikita Sobolev

0.13.0 aka The Lintoberfest

This is a huge release that was created during the Hactoberfest season. It would have been impossible without the huge help from our awesome contributors. Thanks a lot to everyone!

This release is not focused on any particular area. It features a lot of new rules from different categories.

Features

  • Adds cognitive complexity metric, introduced by cognitive_complexity
  • Adds docstrings linter darglint
  • Updates pep8-naming and flake8-comprehensions
  • WPS431 now allow customize whitelist via nested-classes-whitelist setting
  • Forbids to have invalid strings in stared expressions like **{'@': 1}
  • Forbids to use implicit primitive values in a form of lambda: 0
  • Forbids to use approximate math constants
  • Forbids to redefine string constants
  • Forbids use of vague import names (e.g. from json import loads)
  • Makes OveruseOfNoqaCommentViolation configurable via --max-noqa-comments
  • Forbid incorrectly swapped variables
  • Forbids to use redundant subscripts (e.g., [0:7] or [3:None])
  • Allows super() as a valid overused expression
  • Forbids to use super() with other methods and properties
  • WPS350 enforces using augmented assign pattern
  • Forbids unnecessary literals
  • WPS525 forbids comparisons where in is compared with single item container
  • Forbids wrong annotations in assignment
  • Forbids using multiline for and while statements
  • WPS113 now can be tweaked with I_CONTROL_CODE setting
  • Adds WPS000 that indicates internal errors
  • Forbids to use implicit yield from

Full changelog: https://github.com/wemake-services/wemake-python-styleguide/releases/tag/0.13.0

Published on November 20, 2019 by Nikita Sobolev

Budget

See how money openly circulates through wemake-python-styleguide. All contributions and all expenses are published in our transparent public ledger. Learn who is donating, how much, where is that money going, submit expenses, get reimbursed and more!

Monthly financial contribution to wemake-python-styleguid...

PJSC "Rostelecom" | 4/1/2020 | View Details 
+$100.00USD

Financial contribution to wemake-python-styleguide

dry-python | 3/29/2020 | View Details 
+$5.00USD

Financial contribution to wemake-python-styleguide

Marco Roose | 3/4/2020 | View Details 
+$10.00USD

Today’s balance

$202.32 USD

Estimated annual budget

~ $1,095.52 USD

wemake-python-styleguide is all of us

Our contributors 15

Everyone who has supported wemake-python-styleguide. Individuals and organizations that believe in –and take ownership of– our purpose.

Nikita Sobolev
Collective Admin

Total contributions

$5 USD

A little bit of self support!

PJSC "Rostele...
Financial Contributor

Total contributions

$900 USD

Bronze sponsor

Chaim Krause
Financial Contributor

Total contributions

$10 USD

Just what I (and my collaborators) need !! Bye Bye Black.

Matthew Emery
Financial Contributor

Total contributions

$10 USD

Say "Thanks!"

Marco Roose
Financial Contributor

Total contributions

$10 USD

Wemake provides tools to make me a better developer. Thanks for that!

Valentin Domb...
Financial Contributor

Total contributions

$5 USD

Say "Thanks!"

Artem Malyshev
Financial Contributor

Total contributions

$5 USD

The best linter for Python ever!

MoscowPython
Financial Contributor

Total contributions

$5 USD

Say "Thanks!"

Drylabs
Financial Contributor

Total contributions

$5 USD

Say "Thanks!"

Kirill
Financial Contributor

Total contributions

$5 USD

Enjoy this style guide along with other wemake.services' initiatives

Artem B
Financial Contributor

Total contributions

$5 USD

Say "Thanks!"

git-secret
Financial Contributor

Total contributions

$5 USD

Say "Thanks!"

About

wemake-python-styleguide is actually a flake8 plugin with some other plugins as dependencies.