wemake-python-styleguide v0.14.0 Release Notes

Release Date: 2020-03-22 // over 2 years ago
  • ๐Ÿš€ 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 nice migration guide.

    One more thing: flake8 still fails on := operator.
    And there's nothing we can do about it.
    ๐Ÿ‘• Please, be patient โ€“ this linter does not allow to have := in the source code anyway!

    ๐Ÿ”‹ 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


    • ๐Ÿ”„ 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