Releases: wemake-services/wemake-python-styleguide
Releases · wemake-services/wemake-python-styleguide
Version 0.7.0
Features
- Now raising a violation for every
boolnon-keyword argument
and showing better error message - Changes how
max-argumentsare counted.
Nowself,cls, andmcscount as real arguments - Forbids to use
yieldinside comprehensions - Forbids to have single line triple-quoted string assignments
- Forbids to have same items in
setliterals - Forbids to subclass
BaseException - Forbids to use simplifiable
ifexpressions and nodes - Forbids to have incorrect nodes in
classbody - 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
exceptcases - Enforces to have an empty line after
codingcomment - Forbids to use too many
# noqacomments - Forbids to use variables declared as unused
- Forbids to use redundant
elseblocks - Forbids to use inconsistent
returnandyieldstatements - Forbids to use multiple
returnpath intry/expect/finally - Forbids to use implicit string concatenation
- Forbids to have useless
continuenodes inside the loops - Forbids to have useless nodes
- Forbids to have useless
raisestatements - Adds
paramsandparametersto black-listed names
Bugfixes
- Fixes a lot of rules that were ignoring
Bytesnode as constant type - Fixes location of the
BooleanPositionalArgumentViolation - Fixes argument count issue with
asyncfunctions - Fixes
WrongConditionalVisitornot detectingtupleas constants - Fixes
WrongConditionalVisitornot 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
safetyand other dependency checks to the CI process - Improves tests: now
tokenizeworks 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
astorwhere 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
flake8is executed, now it is twice as fast - Improves docs: now linting
conf.pywithflake8 - 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
checkerwithout extra junk - Improves docs: we now have a tutorial for creating new rules
- Refactoring: moves
presetspackage to the root - Improves tests: we now lint our layered architecure with
layer-lint
Version 0.6.3
Bugfixes
- Fixes an issue-450 with
dicts with just values and no keys
Version 0.6.2
Bugfixes
- Fixes a crash with class attributes assignment
Version 0.6.1
Bugfixes
- Fixes a conflict between our plugin and
pyflakes
Version 0.6.0
Features
- Adds
flake8-per-file-ignoredependency - Adds default values to the
flake8 --helpoutput - Adds
doas a restricted variable name - Forbids multiple assignment targets for context managers
- Forbids to use incorrect multi-line parameters
- Forbids to use
boolvalues 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
exceptblocks
Bugfixes
- Fixes tests failing on windows (@sobolevn hates windows!),
but it still fails sometimes - Fixes bug when
@staticmethodwas 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
asyncnodes offset in a special transformation - Improves docs: specifies what
transformationis - Improves docs: making contributing section in the
READMEmore friendly - Improves build: changes how CI installs
poetry
Version 0.5.1
Bugfixes
- Fixes all possible errors that happen
because of unsetparentandfunction_typeproperties
Version 0.5.0
Features
- Breaking: removes
--max-conditionsand--max-elifsoptions - Breaking: removes
--max-offset-blocks - Breaking: changes default
TooManyConditionsViolationthreshold from3to4 - Breaking: changes
TooManyBaseClassesViolationcode from225to215 - Forbids to use
lambdainside loops - Forbids to use
self,cls, andmcsexcept 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
variableto the blacklisted names - Now
RedundantLoopElseViolationalso checkswhileloops
Bugfixes
- Fixes
TooManyConditionsViolationto work with any conditions, not justifs - Fixes
TooManyConditionsViolationthat did not count conditions correctly - Fixes
TooManyForsInComprehensionViolationto find all comprehension types - Fixes
TooManyElifsViolationto check module level conditions - Fixes
TooManyBaseClassesViolationdocs location - Fixes
WrongVariableNameViolationnot checkinglambdaargument names - Fixes
OffsetVisitorincorrectawaithandling
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 justpages/ - 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 allastexamples - Improves tests: now we are sure about correct order of violations
Version 0.4.0
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-lengthoptions - Breaking: renames
--min-variable-name-lengthinto--min-name-length - Dependencies: updates
flake8version to3.6 - Dependencies: removes
pycodestylepinned version
Bugfixes
- Multiple fixes to error text formats to be more readable
- Fixes
UNDERSCORED_NUMBER_PATTERNto match names likecome_22_me - Fixes
UpperCaseAttributeViolationnot being displayed in the docs - Fixes consistency checks being duplicated in the docs
- Fixes
UnderscoredNumberNameViolationshowing incorrect line number - Fixes
ProtectedAttributeViolationto respectsuper()andmcs - Fixes
ProtectedAttributeViolationto show correct text - Fixes
BadNumberSuffixViolationto show correct text - Fixes
TooManyBaseClassesViolationto show correct text - Fixes
TooManyElifsViolationto show correct text - Fixes
TooDeepNestingViolationto show correct text - Fixes
TooManyMethodsViolationto show correct text - Fixes
ReassigningVariableToItselfViolationto show correct text - Renames
UnderscoredNumberNameViolationtoUnderscoredNumberNameViolation
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
Version 0.3.0 aka The Hacktoberfest Feast
This release was made possible by awesome people who contributed
to the project during #hactoberfest. List of awesome people:
- @novikovfred
- @riyasyash
- @sathwikmatsa
- @tipabu
- @roxe322
- @geoc0ld
- @lensvol
- @SheldonNunes
- @tommbee
- @valignatev
- @vsmaxim
Features
- Adds
flake8-printas a dependency - Adds
typing-extensionsas a dependency - Forbids to use
quitandexitfunctions - Forbids the comparison of two literals
- Forbids the incorrect order comparison, enforcing variable to come first
- Forbids underscores before numbers in names
- Forbids class level attributes whose name is not in
snake_case - Forbids comparison of the same variables
- Forbids inconsistent octal, binary, and hex numbers
- Forbids too many arguments in
lambdafunctions - Forbids extra
objectin parent classes list - Forbids
forloops with unusedelse - Forbids variables self reassignment
- Forbids
trywithfinallywithoutexcept - Forbids
ifstatements with invalid conditionals - Forbids opening parenthesis from following keyword without space in between them
- Forbids the use of more than 2
forloops within a comprehension - Forbids variable names with more than one consecutive underscore
- Restricts the maximum number of base classes aka mixins
- Forbids importing protected names
- Forbids using protected methods and attributes
- Forbids
yieldinside__init__method
Bugfixes
- Fixes that
MultipleIfsInComprehensionViolationwas not enabled - Fixes flaky behaviour of
test_module_namestest package - Fixed
TooManyMethodsViolationnot displaying line number in output - Fixed
OffsetVisitordue to python bug
Misc
- Updates
poetryversion - Refactoring: some general changes, including better names and APIs
- Improves docs: now we have
versionaddedfor each violation - Improves docs: now we explicitly state how some violations might be ignored
- Improves tests: now we are testing options
- Improves tests: now we have different
tests/folder structure - Improves tests: now we are testing presets
- Improves tests: now we are using different logic inside
assert_errors - Improves tests: now testing magic numbers in more situations
- Improves tests: now testing more situations with empty base classes
- Improves tests: now testing presets, that they have all the existing visitors
- Improves tests: now using stricter
noqachecks - Improves tests: now testing that any name is allowed when using a variable
- Improves types: now all class attributes are marked as
ClassVar - Improves types: now we use
finalto indicate what should not be changed - Improves types: now we do not have any ugly import hacks
Version 0.2.0
This release was made possible by awesome people who contributed
to the project during #hactoberfest. List of awesome people:
Features
- Now we are counting
asyncfunction as a module member - We now forbid to use
credits()builtin function - We now check
async forandasync withnesting level - We now check
async forandasync withvariable names - We now count
asyncmethods as method for classes complexity check - We now count
asyncfunctions as functions for module complexity check - We now check
asyncfunctions names and arguments - We now count
asyncfunctions complexity - We now ignore
asyncfunctions in jones complexity check - We now check for nested
asyncfunctions - We now check for
asyncfunctions with@staticmethoddecorator
Misc
- Improves docs: add
usage.rst - Improves docs: adds naming convention to the
naming.py - Improves docs: multiple typos, bugs, and issues fixes
- Improves tests: now we are testing
asynccomprehensions