Version history¶
We follow Semantic Versions since the 0.1.0 release.
We used to have incremental versioning before 0.1.0.
Semantic versioning in our case means:
Bugfixes do not bring new features, code that passes on
x.y.0should pass onx.y.1. With the only exception that bugfix can raise old violations in new places, if they were hidden by a buggy behaviour.Minor releases do bring new features and configuration options. New violations can be added. Code that passes
x.0.ymight not pass onx.1.yrelease.Major releases inidicate significant milestones or serious breaking changes.
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 nice migration guide.
Features¶
Breaking: removes
flake8-executable, now usingWPS452instead ofEXE001..EXE005Breaking: removes
flake8-print, now usingWPS421instead ofT001Breaking: removes
flake8-builtins, now usingWPS125instead ofA001..A005Breaking: removes
flake8-annotations-complexity, now usingWPS234instead ofTAE002Breaking: removes
flake8-pep3101, now usingWPS323instead ofS001, we also use a new logic for this violation: we check string defs for%patterns, and not for%operatorBreaking:
WPS441is no longer triggered forexceptblocks, it is now handled byF821fromflake8Breaking: removes
radon, becausecognitive-complexityandmccabeis enoughBreaking: removes
flake8-loggin-formatas a direct dependencyBreaking: removes
ImplicitTernaryViolationorWPS332, because it has too many false positives #1099Removes
flake8-coding, all encoding strings, visitor and tests for oldWPS323which is now reused for modulo formatting checksAdds
python3.8supportChanges
styleguide.tomlandflake8.tomlscripts definitionExtracts new violation -
WPS450fromWPS436#1118Adds domain names options:
--allowed-domain-namesand--forbidden-domain-names, that are used to create variable names’ blacklist #1106Forbids to use
\r(carriage return) as line breaks in strings #1111Forbids to use
:=operator, it now reusesWPS332codeForbids to use positional only
/argumentsForbids to have too many names imported from a single
from ... importForbids to use
continueandbreakinfinallyForbids to use
__reduce__and__reduce_ex__magic methodsAdds
__call__to list of methods that should be on top #1125Allows
_to be now used as a defined variableRemoves
cognitive_complexitydependency, now it is built in into our linterAdds baseline information for all complexity violation messages:
x > baselineChanges how cognitive complexity is calculated
Adds support for positional arguments in different checks
Adds
UnreadableNameViolationasWPS124because there are some character combination which is not easy to readAdds support for
NamedExprwith in compare type violation
Bugfixes¶
Fixes how
i_control_codebehaves withWPS113Fixes that cognitive complexity was ignoring
ast.Continue,ast.Break, andast.RaisestatementsFixes that cognitive complexity was ignoring
ast.AsyncForloopsFixes that annotation complexity was not reported for
asyncfunctionsFixes that annotation complexity was not reported for lists
Fixes that annotation complexity was not reported for
*and/argsFixes that annotation complexity was not tested for dot notation attributes
Fixes that annotation complexity fails on string expressions
Fixes bug when
TooManyPublicAttributesViolationwas counting duplicate fieldsFixes negated conditions
WPS504was not reported forifexpressionsFixes that
import dumpswas reported asWPS347, now onlyfrom ... import dumpsis checkedFixes that
from some import a as stdwas reported as a vague import withWPS347despite having a meaningful aliasFixes that
WPS501was reported for@contextmanagerdefinitionFixes
WPS226to be thrown at nested string type annotationsFixes
WPS204reported simplest nodes as overused like[]andcall()Fixes
WPS204not reporting overusedfstringsFixes
WPS204reporting overused return type annotationsFixes
WPS204reportingself.attribute accessFixes
WPS331reporting cases that do require some extra steps before returnFixes
WPS612not reporingsuper()calls without returnFixes
WPS404not raising on wrong*and/defaultsFixes
WPS425raising on.get,getattr,setattr, and other builtin functions without keyword argumentsFixes
WPS221reporting differently on differentpythonversionsFixes
WPS221reporting nested variable annotationsFixes
WPS509not reporting nested ternary in grandchildren ofifFixes
WPS509not reporting nested ternary in ternaryFixes
WPS426not reporting nestedlambdain comprehensionsFixes several violations to reporting for
ast.Bytesandast.FormattedStrwhereast.Strwas checkedFixes
WPS601reporting shadowing for non-selfattributesFixes
WPS114not to be so strictFixes
WPS122not raising forforandasync fordefinitionsFixes
WPS400raising for# type: ignore[override]commentsFixes
WPS115not raising for attributes inside other nodes
Misc¶
Changes how tests are executed
Changes how coverage is calculated, adds
coverage-conditional-pluginAdds how a violation can be deprecated
Improves old visitor tests with
/argument casesImproves old visitor tests with
:=casesAdds
local-partial-typesto mypy configUses
abcstdlib’s module to mark abstract base classes #1122Adds
python3.8to the CIUpdates a lot of dependencies
0.13.4¶
This is the last 0.13.x supporting release,
we have to concentrate on python3.8 support
and 0.14.0 which will introduce it to the public.
Bugfixes¶
Fix false positive ImplicitYieldFromViolation for async functions #1057
Fixes nested-classes-whitelist option default value for flake8 prior 3.7.8 #1093
Improve boolean non-keyword arguments validation #1114
Misc¶
Updates
flake8-pep3101Updates
flake8-builtinsUpdates
flake8-eradicateSeveral small refactoring sessions
Adds
hypothesis-based testsAdds
flakehellbase configFixes
flakehelldocsFixes
MAX_NOQA_COMMENTSand related violation docsFixes
OverusedExpressionViolationandTooManyExpressionsViolationdocs
0.13.2¶
Bugfixes¶
Fixes that Github Action was failing for wrong status code
Fixes
NegatedConditionsViolationfalse positive on absentelsein combination withelifFixes
WPS528false positive on augmented assignsFixes incorrect message for
WPS349Fixes that
reviewdogwas not able to create more than30comments per PR
Misc¶
pylintdocs fixedFixes docs about implicit
yieldviolation
0.13.1¶
Bufixes¶
Fixes that
_was marked as invalid byVagueImportViolationFixes that docs for
VagueImportViolationwere misleadingFixes invalid docs for
BracketBlankLineViolation#1020Add more complex example to
ParametersIndentationViolation#1021
Misc¶
Now our GitHub Action can be used to leave PR review comments
0.13.0 aka The Lintoberfest¶
This is a huge release that was created during the Hactoberfest season. It was 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` <https://github.com/Melevir/cognitive_complexity>`_
Adds docstrings linter ``darglint` <https://github.com/terrencepreilly/darglint>`_
Updates
pep8-namingandflake8-comprehensionsWPS431now allow customize whitelist vianested-classes-whitelistsettingForbids to have invalid strings in stared expressions like
**{'@': 1}Forbids to use implicit primitive values in a form of
lambda: 0Forbids to use approximate math constants
Forbids to redefine string constants
Forbids use of vague import names (e.g.
from json import loads)Makes
OveruseOfNoqaCommentViolationconfigurable via--max-noqa-commentsForbid incorrectly swapped variables
Forbids to use redundant subscripts (e.g.,
[0:7]or[3:None])Allows
super()as a valid overused expressionForbids to use
super()with other methods and propertiesWPS350enforces using augmented assign patternForbids unnecessary literals
WPS525forbids comparisons whereinis compared with single item containerForbids wrong annotations in assignment
Forbids using multiline
forandwhilestatementsWPS113now can be tweaked withI_CONTROL_CODEsettingAdds
WPS000that indicates internal errorsForbids to use implicit
yield fromForbids to start lines with
.Enforces better
&,|,>>,<<,^operators usageForbids incorrect exception order
Enforces tuples usage with frozenset constructor
Changes how
WPS444works, now we use stricter logic forwhileandassertForbids to use
yield fromwith incorrect typesForbids to use consecutive
yieldexpressionsEnforces to use
.items()in loopsEnforces using
.get()overkey in dictchecksForbids to use and declare
floatkeys in arrays and dictionariesForbids to use
a[len(a) - 1]because it is justa[-1]Forbids too long call chains like
foo(a)(b)(c)(d)
Bugfixes¶
Fixes
ImplicitElifViolationfalse positives on a specific edge casesFixes
--i-control-codesetting forBadMagicModuleFunctionViolationFixes compatibility with flake8
3.8.xFixes that
not not Truewas not detected asWPS330Fixes addition of
MisrefactoredAssignmentViolationcheckFixes
WrongMagicCommentViolationnot catching certain wrong commentsFixes
BadMagicModuleFunctionViolationfalse positives on class-level methodsFixes
InconsistentReturnViolationfalse positives on nested functionsFixes that
--i-dont-control-codewas not present in command line optionsFixes
BlockVariableVisitorfalse positives on a propertiesFixes that
//was not recognised as a math operationFixes false positive
BlockAndLocalOverlapViolationon annotations without value assignFixes bug when
x and not xwas not detected as the similar conditions byWPS408Fixed that
1.0and0.1were treated as magic numbers
Misc¶
Improves Github Action stability
Replace
scripts/tokens.pyandscripts/parse.pywith external toolsImproves violation code testing
Improves testing of
.. versionchangedandprevious_codespropertiesReference
isortsettings requirement for compliance withWSP318in docstringImproves tests: we now ensure that each violation with previous codes also has corresponding versions changed in their documentation
0.12.5¶
Bugfixes¶
We now ignore
@overloadfromBlockAndLocalOverlapViolationNow expressions that reuse block variables are not treated as violations, example:
my_var = do_some(my_var)
Misc¶
Adds Github Action and docs how to use it
Adds local Github Action that uses itself for testing
Adds official Docker image and docs about it
0.12.3¶
Bugfixes¶
Fixes that formatting was failing sometimes when colours were not available
Fixes that
1 / numberwas not allowedFixes that
%operator was allowed for0and1
0.12.2¶
Features¶
Adds
reveal_typeto the list of forbidden functionsWPS517now allows to use non-string keys inside**{}, so this is allowed:Users.objects.get(**{User.USERNAME_FIELD: username})
Bugfixes¶
Fixes that
{**a, **b}was reported as duplicate hash items
0.12.1¶
Features¶
Tweaks
nitpickconfiguration
Bugfixes¶
Changes
radonandpydocstyleversions for better resolutionFixes
nitpickurls
Misc¶
Improves
README.mdwithflakehellandnitpickmentionsImproves docs all across the project
0.12.0¶
In this release we had a little focus on:
Primitives and constants and how to use them
Strings and numbers and how to write them
OOP features
Blocks and code structure, including variable scoping and overlaping variables
Overused expressions and new complexity metrics
Features¶
Breaking: moves
ImplicitInConditionViolationfromWPS336toWPS514Breaking: now
ExplicitStringConcatViolationusesWPS336Breaking: moves
YieldMagicMethodViolationfromWPS435toWPS611Adds
xenonas a dependency, it also checks for cyclomatic complexity, but uses more advanced algorithm with better resultsForbids to have modules with too many imported names configured by
--max-imported-namesoption which is 50 by defaultForbids to raise
StopIterationinside generatorsForbids to have incorrect method order inside classes
Forbids to make some magic methods async
Forbids to use meaningless zeros in float, binary, octal, hex, and expanentional numbers
Enforces to use
1e10instead of1e+10Enforces to use big letters for hex numbers:
0xABinstead of0xabEnforces to use
r'\n'instead of'\\n'Forbids to have unicode escape characters inside binary strings
Forbids to use
else ifinstead ofelifForbids to have too long
trybodies, basicallytrybodies with more than one statementForbids to overlap local and block variables
Forbids to use block variables after the block definitions
Changes how
WrongSlotsViolationworks, now(...) + valueis restricted in favor of(..., *value)Forbids to have explicit unhashable types in sets and dicts
Forbids to define useless overwritten methods
Enforces
jprefix overJforcomplexnumbersForbids overused expressions
Forbids explicit
0division, multiply, pow, addition, and substractionFordids to pow, multiply, or divide by
1Forbids to use expressions like
x + -2, ory - -1, orz -= -1Forbids to multiply lists like
[0] * 2Forbids to use variable names like
__and_____Forbids to define unused variables explicitly:
_unused = 2Forbids to shadow outer scope variables with local ones
Forbids to have too many
assertstatements in a functionForbids to have explicit string contact:
'a' + some_data, use.format()Now
YieldInsideInitViolationis namedYieldMagicMethodViolationand it also checks different magic methods in a classForbids to use
assert Falseand other false-constantsForbids to use
while False:and other false-constantsForbids to use
open()outside ofwithForbids to use
type()for comparesForbids to have consecutive expressions with too deep access level
Forbids to have too many public instance attributes
Forbids to use pointless star operations:
print(*[])Forbids to use
range(len(some)), useenumerate(some)insteadForbids to use implicit
sum()calls and replace them with loopsForbids to compare with the falsy constants like
if some == []:
Bugfixes¶
Bumps
flake8-eradicateversion and solvesattrsincompatible versions issueBumps
flake8-dosctringsveresion and solvedpydocstyleissueFixes
TryExceptMultipleReturnPathViolationnot trackingelseandfinallyreturns at the same timeFixes how
TryExceptMultipleReturnPathViolationworks: now handlesbreakandraisestatements as wellFixes
WrongLoopIterTypeViolationnot triggering for generator expressions and empty tuplesFixes
WrongLoopIterTypeViolationnot triggering for numbers (including negative), booleans,NoneFixes
WrongLoopIterTypeViolationpositionFixes
WrongLoopIterTypeViolationnot triggering for compehensionsFixes
WrongSlotsViolationnot triggering for comprehensions and incorrect__slots__names and typesFixes
WrongSlotsViolationnot triggering for invalidpythonidentifiers like__slots__ = ('123_slot',)Fixes
WrongSlotsViolationtriggering for subscriptsFixes
NestedClassViolationandNestedFunctionViolationnot reporting when placed deeply inside other nodesFixes when
WrongUnpackingViolationwas not raised forasync forandasync withnodesFixes when
WrongUnpackingViolationwas not raised for comprehensionsFixes that
x, y, z = x, z, ywas not recognized asReassigningVariableToItselfViolationFixes that
{1, True, 1.0}was not recognised as a set with duplicatesFixes that
{(1, 2), (1, 2)}was not recognised as a set with duplicatesFixes that
{*(1, 2), *(1, 2)}was not recognised as a set with duplicatesFixes that
{1: 1, True: 1}was not recognised as a dict with duplicatesFixes that
complexnumbers were always treated like magic, now1jis allowedFixes that
0.0was treated as a magic numberFixes that it was possible to use
_in module bodyFixes
WrongBaseClassViolationnot triggering for nested nodes likeclass Test(call().length):Fixes
ComplexDefaultValueViolationnot triggering for nested nodes likedef func(arg=call().attr)Fixes
TooShortNameViolationwas not triggering for_xandx_Fixes that some magic method were allowed to be generators
Fixes that some magic method were allowed to contain
yield fromFixes bug when some correct
noqa:comments were reported as incorrectFixes bug when some
else: returnwere not reported as incorrectFixes bug when
WPS507sometimes were raisingValueErrorFixes bug when
return Nonewas not recognized as inconsistent
Misc¶
Adds
styles/directory with style presets for tools we use and recommendAdds
bellybuttonto the list of other lintersDocuments how to use
nitpickto sync the configurationDocuments how to use
flakehellto createbaselines for legacy integrationsImproves tests for binary, octal, hex, and expanetional numbers
Adds new
xenonCI checkNow handles exceptions in our own code, hope to never see them!
Now uses
coveragechecks in deepsourceNow
@aliaschecks that all aliases are validChanges how presets are defined
Improves how
DirectMagicAttributeAccessViolationis testedRefactors a lot of tests to tests
ast.StarredRefactors a lot of tests to have less tests with the same logical coverage
We now use
import-linterinstead oflayer-linterAdds docs about CI integration
Now wheels are not universal
Updates docs about
snake_caseinEnumfieldsUpdates docs about
WPS400and incorrect line number
0.11.0 aka The New Violation Codes¶
We had a really big problem: all violations inside best_practices
was messed up together with no clear structure.
We had to fix it before it is too late. So, we broke existing error codes. And now we can promise not to do it ever again.
We also have this nice migration guide for you to rename your violations with a script.
Features¶
Breaking: replaces
Zerror code toWPScodeBreaking: creates new violation group
refactoring.pyBreaking: creates new violation group
oop.pyBreaking: moving a lot of violations from
best_practicestorefactoring,oop, andconsistencyAdds new
wemakeformatter (using it now by default)
Bugfixes¶
Fixes error message of
OverusedStringViolationfor empty stringsNow does not count string annotations as strings for
OverusedStringViolationFixes
InconsistentReturnVariableViolationwas raised twice
Misc¶
Adds migration guide to
0.11Improves legacy guide
Adds
--show-sourceto the default recommended configurationAdds better docs about auto-formatters
Adds
autopep8to CI to make sure thatwpsis compatible with itEnsures that
--diffmode works forflake8Renames
IncorrecttoWrongwhere possibleRenames
IncorrectlyNestedTernaryViolationtoNestedTernaryViolationRenames
IncorectLoopIterTypeViolationtoWrongLoopIterTypeViolation
0.10.0 aka The Great Compare¶
This release is mostly targeted at writing better compares and conditions. We introduce a lot of new rules related to this topic improving: consistency, complexity, and general feel from your code.
In this release we have ported a lot of existing pylint rules,
big cudos to the developers of this wonderful tool.
Features¶
Adds
flake8-executableas a dependencyAdds
flake8-rst-docstringsas a dependencyValidates options that are passed with
flake8Forbids to use module level mutable constants
Forbids to over-use strings
Forbids to use
breakpointfunctionLimits yield tuple lengths
Forbids to have too many
awaitstatementsForbids to subclass lowercase
builtinsForbids to have useless
lambdasForbids to use
len(sized) > 0andif len(sized)style checksForbids to use repeatable conditions:
flag or flagForbids to write conditions like
not some > 1Forbids to use heterogenous compares like
x == x > 0Forbids to use complex compare with several items (
>= 3)Forbids to have class variables that are shadowed by instance variables
Forbids to use ternary expressions inside
ifconditionsForces to use ternary instead of
... and ... or ...expressionForces to use
c < b < ainstead ofa > b and b > cForces to use
c < b < ainstead ofa > b > cForbids to use explicit
in []andin (), use sets or variables insteadForces to write
isinstance(some, (A, B))instead ofisinstance(some, A) or isinstance(some, B)Forbids to use
isinstance(some (A,))Forces to merge
a == b or a == cintoa in {b, c}and to mergea != b and a != cintoa not in {b, c}
Bugfixes¶
Fixes incorrect line number for
Z331Fixes that
Z311was not raising for multiplenot incasesFixes a bunch of bugs for rules working with
Assignand notAnnAssignFixes that
continuewas not triggeringUselessReturningElseViolation
Misc¶
Renames
logics/tologic/since it is grammatically correctRenames
RedundanttoUselessRenames
ComparisontoCompareRenames
WrongConditionalViolationtoConstantConditionViolationRenames
ComplexDefaultValuesViolationtoComplexDefaultValueViolationRefactors
UselessOperatorsVisitorAdds
compat/package, getting ready forpython3.8Adds
MakefileA lot of minor dependency updates
0.9.0¶
This is mostly a supporting release with several new features and lots of bug fixes.
Features¶
Forbids to use magic module methods
__getattr__and__dir__Forbids to use multiline conditions
Forbids local variables that are only used in
returnstatements
Bugfixes¶
Fixes module names for modules like
io.pyFixes false positive
Z310for numbers like0xEFixes false positive for compare ordering with
awaitFixes problem with missing
_allowed_left_nodesFixes problem false positive for
Z121when using_for unused var namesFixes false positive for negative number in default values
Fixes error text for
ComplexDefaultValueViolationFixes problem with false positive for
Z459when a default value is anEllipsis
Misc¶
Adds
py.typedfile in case someone will import our code, now it will have typesAdds several missing
@finaldecoratorsEnforces typing support
Refactors how
typing_extensionspackage is usedAdds docs about
blackAdds big “Star” button
Multiple dependencies update
Better
excluderule forflake8checkRemoved warnings from
pytest
0.8.0¶
Features¶
Updates
flake8to3.7+Adds
flake8-annotations-complexityas a dependency, forbids complex annotationsForbids to use redundant
+,~,not, and-operators before numbersForbids to use complex default values
Forbids to use anything rather than names in
forloop vars definitionsForbids to use anything rather than names in
withblock vars definitionsForbids 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 covercommentsForbids to use nested
tryblocks
Bugfixes¶
Fixes problems with empty lines after magic comments, see #492
Fixes error message for
delkeyword: it is now just'del'not'delete'
Misc¶
Removes
flake8-per-file-ignoresplugin, sinceflake8now handles itRemoves
flake8-type-annotationsplugin, sinceflake8now handles itImproves docs for
WrongKeywordViolationImproves docs for
EmptyLineAfterCodingViolationImproves docs for
ProtectedAttributeViolationAdds docs about
.pyifiles
0.7.1¶
Bugfixes¶
Allows
Generic[SomeType]to be a valid superclassForces to use
flake8version3.6instead of3.7
Misc¶
Improves docs about using
# type: somecomment inforloops
0.7.0¶
Features¶
Now raising a violation for every
boolnon-keyword argument and showing better error messageChanges how
max-argumentsare counted Nowself,cls, andmcscount as real argumentsForbids to use
yieldinside comprehensionsForbids to have single line triple-quoted string assignments
Forbids to have same items in
setliteralsForbids to subclass
BaseExceptionForbids to use simplifiable
ifexpressions and nodesForbids to have incorrect nodes in
classbodyForbids to have methods without any arguments
Forbids to have incorrect base classes nodes
Enforces consistent
__slots__syntaxForbids to use names with trailing
_without a reasonForbids to use
super()with arguments or outside of methodsForbids to have too many
exceptcasesEnforces to have an empty line after
codingcommentForbids to use too many
# noqacommentsForbids to use variables declared as unused
Forbids to use redundant
elseblocksForbids to use inconsistent
returnandyieldstatementsForbids to use multiple
returnpath intry/expect/finallyForbids to use implicit string concatenation
Forbids to have useless
continuenodes inside the loopsForbids to have useless nodes
Forbids to have useless
raisestatementsAdds
paramsandparametersto black-listed names
Bugfixes¶
Fixes a lot of rules that were ignoring
Bytesnode as constant typeFixes location of the
BooleanPositionalArgumentViolationFixes argument count issue with
asyncfunctionsFixes
WrongConditionalVisitornot detectingtupleas constantsFixes
WrongConditionalVisitornot detecting negative numbers as constantsFixes 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 violationFixes error when string like
U'some'was not triggering modifier violation
Misc¶
Adds
safetyand other dependency checks to the CI processImproves tests: now
tokenizeworks differently inside testsImproves 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 codebaseRefactoring: introduces some new
transformationsRefactoring: now we do not have any magical text casts for violations
Improves tests: changes how
flake8is executed, now it is twice as fastImproves docs: now linting
conf.pywithflake8Improves tests: now we check that ignored violation are raised with
noqaImproves docs: we have added a special graph to show our architecure
Improves docs: we now have a clean page for
checkerwithout extra junkImproves docs: we now have a tutorial for creating new rules
Refactoring: moves
presetspackage to the rootImproves tests: we now lint our layered architecure with
layer-lint
Version 0.6.0¶
Features¶
Adds
flake8-per-file-ignoreplugin dependencyAdds default values to the
flake8 --helpoutputAdds
doas a restricted variable nameForbids multiple assignment targets for context managers
Forbids to use incorrect multi-line parameters
Forbids to use
boolvalues as positional argumentsForbids 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
NameForbids 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 memberFixes bug when some nodes were not checked with
TooDeepNestingViolationFixes 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 underscoredFixes bug when assignment to anything rather than name was raising an error
Misc¶
Refactoring: now we fix
asyncnodes offset in a special transformationImproves docs: specifies what
transformationisImproves docs: making contributing section in the
READMEmore friendlyImproves build: changes how CI installs
poetry
0.5.1¶
Bugfixes¶
Fixes all possible errors that happen because of unset
parentandfunction_typeproperties
0.5.0¶
Features¶
Breaking: removes
--max-conditionsand--max-elifsoptionsBreaking: removes
--max-offset-blocksBreaking: changes default
TooManyConditionsViolationthreshold from3to4Breaking: changes
TooManyBaseClassesViolationcode from225to215Forbids to use
lambdainside loopsForbids to use
self,cls, andmcsexcept for first arguments onlyForbids 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 namesNow
RedundantLoopElseViolationalso checkswhileloops
Bugfixes¶
Fixes
TooManyConditionsViolationto work with any conditions, not justifsFixes
TooManyConditionsViolationthat did not count conditions correctlyFixes
TooManyForsInComprehensionViolationto find all comprehension typesFixes
TooManyElifsViolationto check module level conditionsFixes
TooManyBaseClassesViolationdocs locationFixes
WrongVariableNameViolationnot checkinglambdaargument namesFixes
OffsetVisitorincorrectawaithandling
Misc¶
Refactoring: moves all complexity checks into
complexity/folderRefactoring: 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.pyImproves tests: now we also run
compile()on allastexamplesImproves tests: now we are sure about correct order of violations
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-lengthoptionsBreaking: renames
--min-variable-name-lengthinto--min-name-lengthDependencies: updates
flake8version to3.6Dependencies: removes
pycodestylepinned versionRestrict unicode names
Bugfixes¶
Multiple fixes to error text formats to be more readable
Fixes
UNDERSCORED_NUMBER_PATTERNto match names likecome_22_meFixes
UpperCaseAttributeViolationnot being displayed in the docsFixes consistency checks being duplicated in the docs
Fixes
UnderscoredNumberNameViolationshowing incorrect line numberFixes
ProtectedAttributeViolationto respectsuper()andmcsFixes
ProtectedAttributeViolationto show correct textFixes
BadNumberSuffixViolationto show correct textFixes
TooManyBaseClassesViolationto show correct textFixes
TooManyElifsViolationto show correct textFixes
TooDeepNestingViolationto show correct textFixes
TooManyMethodsViolationto show correct textFixes
ReassigningVariableToItselfViolationto show correct textRenames
UnderscoredNumberNameViolationtoUnderscoredNumberNameViolation
Misc¶
Refactoring: removed duplicate logic inside
logics/filenames.pyImproves tests: now testing almost all violations inside
noqa.pyImproves tests: now testing violations text
Improves tests: now all common patters live in related
conftest.pyImproves docs: now all configuration options are listed in the violations
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:
Features¶
Adds
flake8-printas a dependencyAdds
typing-extensionsas a dependencyForbids to use
quitandexitfunctionsForbids 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_caseForbids comparison of the same variables
Forbids inconsistent octal, binary, and hex numbers
Forbids too many arguments in
lambdafunctionsForbids extra
objectin parent classes listForbids
forloops with unusedelseForbids variables self reassignment
Forbids
trywithfinallywithoutexceptForbids
ifstatements with invalid conditionalsForbids opening parenthesis from following keyword without space in between them
Forbids the use of more than 2
forloops within a comprehensionForbids 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 enabledFixes flaky behaviour of
test_module_namestest packageFixed
TooManyMethodsViolationnot displaying line number in outputFixed
OffsetVisitordue to python bug
Misc¶
Updates
poetryversionRefactoring: some general changes, including better names and APIs
Improves docs: now we have
versionaddedfor each violationImproves 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 structureImproves tests: now we are testing presets
Improves tests: now we are using different logic inside
assert_errorsImproves 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
noqachecksImproves tests: now testing that any name is allowed when using a variable
Improves types: now all class attributes are marked as
ClassVarImproves types: now we use
finalto indicate what should not be changedImproves types: now we do not have any ugly import hacks
0.2.0 aka Revenge of the Async¶
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 memberWe now forbid to use
credits()builtin functionWe now check
async forandasync withnesting levelWe now check
async forandasync withvariable namesWe now count
asyncmethods as method for classes complexity checkWe now count
asyncfunctions as functions for module complexity checkWe now check
asyncfunctions names and argumentsWe now count
asyncfunctions complexityWe now ignore
asyncfunctions in jones complexity checkWe now check for nested
asyncfunctionsWe now check for
asyncfunctions with@staticmethoddecorator
Misc¶
Improves docs: add
usage.rstImproves docs: adds naming convention to the
naming.pyImproves docs: multiple typos, bugs, and issues fixes
Improves tests: now we are testing
asynccomprehensions
Version 0.1.0¶
Features¶
Breaking: changes violation codes, now they are grouped by meaning
Misc¶
Refactoring: changes how visitors are organized inside the package
Improves docs: now we have a glossary
Refactoring: refactoring terms that violate our glossary
Improves docs: now all error files contain fancy documentation and summary
Improves docs: now we have added API reference to the docs
Improves docs: adds new plugin development guide
Version 0.0.16¶
Features¶
Adds
flake8-logging-formatdependencyAdds
flake8-type-annotationsdependencyAdds
flake8-breaking-linedependencyRemoves
flake8-super-calldependencyAdds
PartialFloatViolationAdds
MagicNumberViolationAdds
WrongDocCommentViolationAdds
MAGIC_NUMBERS_WHITELISTconstantChanges what variable names are blacklisted, adds
false,true, andno
Misc¶
Improves docs: now including docs for
--max-conditionoptionImproves docs: adds some new
Zen of PythonreferencesImproves tests: adds many new examples
Improves docs: now each error has its error message displayed in the docs
Improves docs: readme is now ready for the release
Improves docs: now error pages are split
Improves docs: now all
flake8plugin dependencies are documented
Version 0.0.15¶
Features¶
Adds
MultipleIfsInComprehensionViolationAdds
TooManyConditionsViolationAdds
--max-conditionsoption
Misc¶
Improves
CONTRIBUTING.mdMoves issues templates to
.github/folderUpdate error thrown on
RedundantSubscriptViolation
Version 0.0.14¶
Features¶
Adds
WrongModuleNamePatternViolationandWrongModuleNameUnderscoresViolationAdds
TooManyImportsViolationerror and--max-importsoptionAdds
--i-control-codeoption to ignoreInitModuleHasLogicViolationAdds check for underscored numbers
Forbids
u''stringsAdds
noqaandtypecomments checks
Misc¶
Changes how many errors are generated for limits violations
Refactors how visitors are injected into the checker, now using presets
Creates new visitor type:
BaseTokenVisitorfor working withtokenizeImproves typing support
Adds
flake8-banditpluginAdds
flake8-eradicatepluginAdds
flake8-printplugin for developmentRemoves
delegateconcept from the codebase
Version 0.0.13 aka The Jones Complexity¶
Features¶
Adds
jonescomplexity checkerAdds
--max-line-complexityand--max-jones-scoreoptions
Misc¶
Improves docs: adds detailed installation instructions
Removes
flake8-blind-exceptplugin
Version 0.0.12¶
This is just a supporting release. There are no new features introduced.
We have changed the error codes for general checks.
Bugfixes¶
Fixes bug with nested imports missing ``parent` <https://github.com/wemake-services/wemake-python-styleguide/issues/120>`_
Fixes bug with incorrect ``pycodestyle` version <https://github.com/wemake-services/wemake-python-styleguide/issues/118>`_
Removes
BareRaiseViolationas it does not fit the purpose of this package
Misc¶
Improves docs: now all errors are sorted by
codeImproves docs: now all errors have reasoning
Improves docs: some references are now clickable in web version
Improves docs: now docs include
CHANGELOG.mdImproves docs: now we have templates for
bugandrule-requestReplaced
pytest-isortwithflake8-isort
Version 0.0.11¶
This is just a supporting release. There are no new features introduced.
Bugfixes¶
Fixes ``python3.7` support <https://github.com/wemake-services/wemake-python-styleguide/issues/93>`_
Fixes ``AttributeError: ‘ExceptHandler’ object has no attribute ‘depth’` <https://github.com/wemake-services/wemake-python-styleguide/issues/112>`_
Misc¶
Introduced the concept of regression testing, see
test/fixtures/regressionRemoved
compat.pyFixes some minor typos, problems, markup inside the docs
Adds some new configuration to
sphinxChanges
sphinxdocs structure a little bit
Version 0.0.10 aka The Module Reaper¶
Features¶
Adds
WrongModuleNameViolation,WrongModuleMagicNameViolation, andTooShortModuleNameViolationAdds
--min-module-name-lengthconfig optionAdds a blacklist of module names
Adds
InitModuleHasLogicsViolationAdds
EmptyModuleViolationAdds a whitelist of magic module names
Bugfixes¶
Fixes
Optionclass to have have incorrecttypefield, now using stringsFixes that
WrongStringTokenVisitorwas not activated
Misc¶
Improved typing support
Now each error has a link to the corresponding constant (if any)
Improved docs with links to the corresponding configuration flags
Version 0.0.9¶
This is just a supporting release. There are no new features introduced.
Bugfixes¶
Fixes
Attribute has no 'id'errorFixes
missing 'typing_extension'error
Misc¶
Errors are now tested
Complexity tests are refactored
Version 0.0.8 aka The Complex Complexity¶
Features¶
Now all dependencies are direct, they will be installed together with this package
Adds direct dependencies, now there’s no need to install any extra packages
Adds
TooDeepNestingViolationandTooManyElifsViolationchecksAdds
--max-offset-blocksand--max-elifsoptionsAdds
TooManyModuleMembersViolationandTooManyMethodsViolationchecksAdds
--max-module-membersand--max-methodsoptionsRestricts to use
fstrings
Bugfixes¶
Removes incorrect
generic_visit()callsRemoves some unused
getattr()callsRefactors how options are registered
Misc¶
Improved type support for options parsing
Version 0.0.7¶
Features¶
Added new magic methods to the black list
We now do not count
_as a variable inTooManyLocalscheckWe now restrict to nest
lambdasWe now allow to configure the minimal variable’s name length via
setup.cfg
Misc¶
Refactored how complexity checks are defined
Refactored how errors are defined
Now each check has strict
Raises:policy which lists all possible errors that this check can find and raiseChanged how visitors are initialized in tests
Tests now cover nested classes’ explicit bases
Tests now cover nested classes and functions
noqacomment
Version 0.0.6¶
Features¶
We now check import aliases to be different from the original name
Default complexity checks’ values have changed
Bugfixes¶
ReadTheDocs build is fixed by providing extra dependencies
Changed how local variables are counted
Misc¶
Improved typing support
Added new documentation sections
Version 0.0.5¶
Features¶
We now allow
generator_stopto be a__future__importWe now restrict dotted raw imports like:
import os.pathWe now check import aliases as regular variable names
Misc¶
We have added a
CONTRIBUTING.mdfile to help new contributors
Version 0.0.4¶
Features¶
We now check
classes to match our styleguideClasses have their own error group
Z3Using
@staticmethodis now forbiddenDeclaring
objectas a base class is now requiredNow we check that
__del__magic method is not usedVariable names
asyncandawaitare forbiddenWe now forbid to use
__future__importsWe now have a whitelist for
__future__importsImports are now have its own subgroup
Z10General rules now start from
Z11
Version 0.0.3¶
Features¶
We now use
Zas the default code for our errorsWe have shuffled errors around, changing code and formats
Now all name errors share the same class
Adds
PrivateNameViolationNow imports inside any structures rather than
Moduleraises an errorAdds
fileandklassas restricted namesNow
__import__is just a bad function name, not a special caseNow version is defined in
poetry.tomlonlyWe now have configuration! And it covers all design errors
Bugfixes¶
Fixes issue with missing
parents :batman:Fixes issue with
_$NAMEpatterns being ignored
Version 0.0.2¶
Features¶
Adds some new blacklisted variables’ names
Adds docs for each existing error code
Adds whitelisted names for nested functions:
decoratorandfactoryAdds new blacklisted module’s metadata variables
Removed
BAD_IMPORT_FUNCTIONSvariable, now just checking__import__
Testing¶
Add gen-tests that cover most of the issues
Removed almost all integration tests, saving just a few of them
Misc¶
Adds
poetryas the main project toolAdds
shpinxas a documentation tool