Skip to content

Releases: wemake-services/wemake-python-styleguide

Version 0.8.0

03 Mar 16:32
b3c1bfa
Compare
Choose a tag to compare

Features

  • Updates flake8 to 3.7+
  • Adds flake8-annotations-complexity as a dependency, forbids complex annotations
  • Forbids to use redundant +, ~, not, and - operators before numbers
  • Forbids to use complex default values
  • Forbids to use anything rather than names in for loop vars definitions
  • Forbids to use anything rather than names in with block vars definitions
  • Forbids to use anything rather than names in comprehension vars definitions
  • Forbids to use direct magic attributes access
  • Forbids to use negated conditions
  • Forbids to use too many # pragma: no cover comments
  • Forbids to use nested try blocks

Bugfixes

  • Fixes problems with empty lines after magic comments, see #492
  • Fixes error message for del keyword: it is now just 'del' not 'delete'

Misc

  • Removes flake8-per-file-ignores plugin, since flake8 now handles it
  • Removes flake8-type-annotations plugin, since flake8 now handles it
  • Improves docs for WrongKeywordViolation
  • Improves docs for EmptyLineAfterCodingViolation
  • Improves docs for ProtectedAttributeViolation
  • Adds docs about .pyi files

Version 0.7.1

08 Feb 12:53
16889fe
Compare
Choose a tag to compare

Bugfixes

  • Allows Generic[SomeType] to be a valid superclass
  • Forces to use flake8 version 3.6 instead of 3.7

Misc

  • Improves docs about using # type: some comment in for loops

Version 0.7.0

23 Jan 08:40
4665b77
Compare
Choose a tag to compare

Features

  • Now raising a violation for every bool non-keyword argument
    and showing better error message
  • Changes how max-arguments are counted.
    Now self, cls, and mcs count as real arguments
  • Forbids to use yield inside comprehensions
  • Forbids to have single line triple-quoted string assignments
  • Forbids to have same items in set literals
  • Forbids to subclass BaseException
  • Forbids to use simplifiable if expressions and nodes
  • Forbids to have incorrect nodes in class body
  • Forbids to have methods without any arguments
  • Forbids to have incorrect base classes nodes
  • Enforces consistent __slots__ syntax
  • Forbids to use names with trailing _ without a reason
  • Forbids to use super() with arguments or outside of methods
  • Forbids to have too many except cases
  • Enforces to have an empty line after coding comment
  • Forbids to use too many # noqa comments
  • Forbids to use variables declared as unused
  • Forbids to use redundant else blocks
  • Forbids to use inconsistent return and yield statements
  • Forbids to use multiple return path in try/expect/finally
  • Forbids to use implicit string concatenation
  • Forbids to have useless continue nodes inside the loops
  • Forbids to have useless nodes
  • Forbids to have useless raise statements
  • Adds params and parameters to black-listed names

Bugfixes

  • Fixes a lot of rules that were ignoring Bytes node as constant type
  • Fixes location of the BooleanPositionalArgumentViolation
  • Fixes argument count issue with async functions
  • Fixes WrongConditionalVisitor not detecting tuple as constants
  • Fixes WrongConditionalVisitor not detecting negative numbers as constants
  • Fixes some magic number that were not detected based on their location
  • Fixes error when regular functions named as blacklisted
    magic methods were forbidden, now we check for methods only
  • Fixes error when strings like U'some' was not triggering unicode violation
  • Fixes error when string like U'some' was not triggering modifier violation

Misc

  • Adds safety and other dependency checks to the CI process
  • Improves tests: now tokenize works differently inside tests
  • Improves tests: now testing more brackets cases aka "magic coverage bug"
  • Improves docs: adds new badge about our code style
  • Refactoring: trying to use astor where possible to simplify the codebase
  • Refactoring: introduces some new transformations
  • Refactoring: now we do not have any magical text casts for violations
  • Improves tests: changes how flake8 is executed, now it is twice as fast
  • Improves docs: now linting conf.py with flake8
  • Improves tests: now we check that ignored violation are raised with noqa
  • Improves docs: we have added a special graph to show our architecure
  • Improves docs: we now have a clean page for checker without extra junk
  • Improves docs: we now have a tutorial for creating new rules
  • Refactoring: moves presets package to the root
  • Improves tests: we now lint our layered architecure with layer-lint

Version 0.6.3

23 Jan 08:39
4a77d81
Compare
Choose a tag to compare

Bugfixes

  • Fixes an issue-450 with dicts with just values and no keys

Version 0.6.2

05 Jan 15:55
300f257
Compare
Choose a tag to compare

Bugfixes

  • Fixes a crash with class attributes assignment

Version 0.6.1

05 Jan 13:16
9a753da
Compare
Choose a tag to compare

Bugfixes

  • Fixes a conflict between our plugin and pyflakes

Version 0.6.0

19 Dec 08:23
18fe9c6
Compare
Choose a tag to compare

Features

  • Adds flake8-per-file-ignore dependency
  • Adds default values to the flake8 --help output
  • Adds do as a restricted variable name
  • Forbids multiple assignment targets for context managers
  • Forbids to use incorrect multi-line parameters
  • Forbids to use bool values as positional arguments
  • Forbids to use extra indentation
  • Forbids to use inconsistent brackets
  • Forbids to use multi-line function type annotations
  • Forbids to use uppercase string modifiers
  • Forbids to use assign chains: now we only can use one assign per line
  • Forbids to use assign with unpacking for any nodes except Name
  • Forbids to have duplicate except blocks

Bugfixes

  • Fixes tests failing on windows (@sobolevn hates windows!),
    but it still fails sometimes
  • Fixes bug when @staticmethod was treated as a module member
  • Fixes bug when some nodes were not checked with TooDeepNestingViolation
  • Fixes bug when it was possible to provide non-unique aliases
  • Fixes incorrect line number for incorrect parameter names
  • Fixes bug when names like __some__value__ were not treated as underscored
  • Fixes bug when assignment to anything rather than name was raising an error

Misc

  • Refactoring: now we fix async nodes offset in a special transformation
  • Improves docs: specifies what transformation is
  • Improves docs: making contributing section in the README more friendly
  • Improves build: changes how CI installs poetry

Version 0.5.1

15 Nov 14:20
d196855
Compare
Choose a tag to compare

Bugfixes

  • Fixes all possible errors that happen
    because of unset parent and function_type properties

Version 0.5.0

10 Nov 12:17
889080f
Compare
Choose a tag to compare

Features

  • Breaking: removes --max-conditions and --max-elifs options
  • Breaking: removes --max-offset-blocks
  • Breaking: changes default TooManyConditionsViolation threshold from 3 to 4
  • Breaking: changes TooManyBaseClassesViolation code from 225 to 215
  • Forbids to use lambda inside loops
  • Forbids to use self, cls, and mcs except for first arguments only
  • Forbids to use too many decorators
  • Forbids to have unreachable code
  • Forbids to have statements that have no effect
  • Forbids to have too long names for modules and variables
  • Forbids to have names with unicode for modules and variables
  • Add variable to the blacklisted names
  • Now RedundantLoopElseViolation also checks while loops

Bugfixes

  • Fixes TooManyConditionsViolation to work with any conditions, not just ifs
  • Fixes TooManyConditionsViolation that did not count conditions correctly
  • Fixes TooManyForsInComprehensionViolation to find all comprehension types
  • Fixes TooManyElifsViolation to check module level conditions
  • Fixes TooManyBaseClassesViolation docs location
  • Fixes WrongVariableNameViolation not checking lambda argument names
  • Fixes OffsetVisitor incorrect await handling

Misc

  • Refactoring: moves all complexity checks into complexity/ folder
  • Refactoring: improves how different keyword visitors are coupled
  • Improves docs: we have removed magic comments and code duplication
  • Improves docs: now _pages/ is named just pages/
  • Improves docs: now all violations are sorted correctly
  • Improves tests: now testing different keywords separately
  • Improves tests: now all violations must be contained in test_noqa.py
  • Improves tests: now we also run compile() on all ast examples
  • Improves tests: now we are sure about correct order of violations

Version 0.4.0

30 Oct 16:00
914c0ec
Compare
Choose a tag to compare

Development was focused around better test coverage and providing a better API
for tests. We also now covering more cases and testing violation texts.

Features

  • Breaking: removes duplicating module name rules, now we use the same rules
    for both variables and modules
  • Breaking: removes --min-module-name-length options
  • Breaking: renames --min-variable-name-length into --min-name-length
  • Dependencies: updates flake8 version to 3.6
  • Dependencies: removes pycodestyle pinned version

Bugfixes

  • Multiple fixes to error text formats to be more readable
  • Fixes UNDERSCORED_NUMBER_PATTERN to match names like come_22_me
  • Fixes UpperCaseAttributeViolation not being displayed in the docs
  • Fixes consistency checks being duplicated in the docs
  • Fixes UnderscoredNumberNameViolation showing incorrect line number
  • Fixes ProtectedAttributeViolation to respect super() and mcs
  • Fixes ProtectedAttributeViolation to show correct text
  • Fixes BadNumberSuffixViolation to show correct text
  • Fixes TooManyBaseClassesViolation to show correct text
  • Fixes TooManyElifsViolation to show correct text
  • Fixes TooDeepNestingViolation to show correct text
  • Fixes TooManyMethodsViolation to show correct text
  • Fixes ReassigningVariableToItselfViolation to show correct text
  • Renames UnderscoredNumberNameViolation to UnderscoredNumberNameViolation

Misc

  • Refactoring: removed duplicate logic inside logics/filenames.py
  • Improves tests: now testing almost all violations inside noqa.py
  • Improves tests: now testing violations text
  • Improves tests: now all common patters live in related conftest.py
  • Improves docs: now all configuration options are listed in the violations