Version history¶
We follow Semantic Versions since the 0.1.0
release.
We used to have incremental versioning before 0.1.0
.
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
return
statements
Bugfixes¶
Fixes module names for modules like
io.py
Fixes false positive
Z310
for numbers like0xE
Fixes false positive for compare ordering with
await
Fixes problem with missing
_allowed_left_nodes
Fixes problem false positive for
Z121
when using_
for unused var namesFixes false positive for negative number in default values
Fixes error text for
ComplexDefaultValuesViolation
Fixes problem with false positive for
Z459
when a default value is anEllipsis
Misc¶
Adds
py.typed
file in case someone will import our code, now it will have typesAdds several missing
@final
decoratorsEnforces typing support
Refactors how
typing_extensions
package is usedAdds docs about
black
Adds big “Star” button
Multiple dependencies update
Better
exclude
rule forflake8
checkRemoved warnings from
pytest
0.8.0¶
Features¶
Updates
flake8
to3.7+
Adds
flake8-annotations-complexity
as 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
for
loop vars definitionsForbids to use anything rather than names in
with
block 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 cover
commentsForbids 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, sinceflake8
now handles itRemoves
flake8-type-annotations
plugin, sinceflake8
now handles itImproves docs for
WrongKeywordViolation
Improves docs for
EmptyLineAfterCodingViolation
Improves docs for
ProtectedAttributeViolation
Adds docs about
.pyi
files
0.7.1¶
Bugfixes¶
Allows
Generic[SomeType]
to be a valid superclassForces to use
flake8
version3.6
instead of3.7
Misc¶
Improves docs about using
# type: some
comment infor
loops
0.7.0¶
Features¶
Now raising a violation for every
bool
non-keyword argument and showing better error messageChanges how
max-arguments
are counted. Nowself
,cls
, andmcs
count as real argumentsForbids to use
yield
inside comprehensionsForbids to have single line triple-quoted string assignments
Forbids to have same items in
set
literalsForbids to subclass
BaseException
Forbids to use simplifiable
if
expressions and nodesForbids to have incorrect nodes in
class
bodyForbids 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
except
casesEnforces to have an empty line after
coding
commentForbids to use too many
# noqa
commentsForbids to use variables declared as unused
Forbids to use redundant
else
blocksForbids to use inconsistent
return
andyield
statementsForbids to use multiple
return
path intry
/expect
/finally
Forbids to use implicit string concatenation
Forbids to have useless
continue
nodes inside the loopsForbids to have useless nodes
Forbids to have useless
raise
statementsAdds
params
andparameters
to black-listed names
Bugfixes¶
Fixes a lot of rules that were ignoring
Bytes
node as constant typeFixes location of the
BooleanPositionalArgumentViolation
Fixes argument count issue with
async
functionsFixes
WrongConditionalVisitor
not detectingtuple
as constantsFixes
WrongConditionalVisitor
not 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
safety
and other dependency checks to the CI processImproves tests: now
tokenize
works 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
astor
where possible to simplify the codebaseRefactoring: 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 fastImproves docs: now linting
conf.py
withflake8
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 junkImproves docs: we now have a tutorial for creating new rules
Refactoring: moves
presets
package to the rootImproves tests: we now lint our layered architecure with
layer-lint
Version 0.6.0¶
Features¶
Adds
flake8-per-file-ignore
plugin dependencyAdds default values to the
flake8 --help
outputAdds
do
as a restricted variable nameForbids multiple assignment targets for context managers
Forbids to use incorrect multi-line parameters
Forbids to use
bool
values 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
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 memberFixes 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 underscoredFixes bug when assignment to anything rather than name was raising an error
Misc¶
Refactoring: now we fix
async
nodes offset in a special transformationImproves docs: specifies what
transformation
isImproves docs: making contributing section in the
README
more friendlyImproves build: changes how CI installs
poetry
0.5.1¶
Bugfixes¶
Fixes all possible errors that happen because of unset
parent
andfunction_type
properties
0.5.0¶
Features¶
Breaking: removes
--max-conditions
and--max-elifs
optionsBreaking: removes
--max-offset-blocks
Breaking: changes default
TooManyConditionsViolation
threshold from3
to4
Breaking: changes
TooManyBaseClassesViolation
code from225
to215
Forbids to use
lambda
inside loopsForbids to use
self
,cls
, andmcs
except 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
variable
to the blacklisted namesNow
RedundantLoopElseViolation
also checkswhile
loops
Bugfixes¶
Fixes
TooManyConditionsViolation
to work with any conditions, not justif
sFixes
TooManyConditionsViolation
that did not count conditions correctlyFixes
TooManyForsInComprehensionViolation
to find all comprehension typesFixes
TooManyElifsViolation
to check module level conditionsFixes
TooManyBaseClassesViolation
docs locationFixes
WrongVariableNameViolation
not checkinglambda
argument namesFixes
OffsetVisitor
incorrectawait
handling
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.py
Improves tests: now we also run
compile()
on allast
examplesImproves 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-length
optionsBreaking: renames
--min-variable-name-length
into--min-name-length
Dependencies: updates
flake8
version to3.6
Dependencies: removes
pycodestyle
pinned versionRestrict unicode names
Bugfixes¶
Multiple fixes to error text formats to be more readable
Fixes
UNDERSCORED_NUMBER_PATTERN
to match names likecome_22_me
Fixes
UpperCaseAttributeViolation
not being displayed in the docsFixes consistency checks being duplicated in the docs
Fixes
UnderscoredNumberNameViolation
showing incorrect line numberFixes
ProtectedAttributeViolation
to respectsuper()
andmcs
Fixes
ProtectedAttributeViolation
to show correct textFixes
BadNumberSuffixViolation
to show correct textFixes
TooManyBaseClassesViolation
to show correct textFixes
TooManyElifsViolation
to show correct textFixes
TooDeepNestingViolation
to show correct textFixes
TooManyMethodsViolation
to show correct textFixes
ReassigningVariableToItselfViolation
to show correct textRenames
UnderscoredNumberNameViolation
toUnderscoredNumberNameViolation
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
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-print
as a dependencyAdds
typing-extensions
as a dependencyForbids to use
quit
andexit
functionsForbids 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
lambda
functionsForbids extra
object
in parent classes listForbids
for
loops with unusedelse
Forbids variables self reassignment
Forbids
try
withfinally
withoutexcept
Forbids
if
statements with invalid conditionalsForbids opening parenthesis from following keyword without space in between them
Forbids the use of more than 2
for
loops 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
yield
inside__init__
method
Bugfixes¶
Fixes that
MultipleIfsInComprehensionViolation
was not enabledFixes flaky behaviour of
test_module_names
test packageFixed
TooManyMethodsViolation
not displaying line number in outputFixed
OffsetVisitor
due to python bug
Misc¶
Updates
poetry
versionRefactoring: some general changes, including better names and APIs
Improves docs: now we have
versionadded
for 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_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
noqa
checksImproves 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
final
to 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
async
function as a module memberWe now forbid to use
credits()
builtin functionWe now check
async for
andasync with
nesting levelWe now check
async for
andasync with
variable namesWe now count
async
methods as method for classes complexity checkWe now count
async
functions as functions for module complexity checkWe now check
async
functions names and argumentsWe now count
async
functions complexityWe now ignore
async
functions in jones complexity checkWe now check for nested
async
functionsWe now check for
async
functions with@staticmethod
decorator
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
async
comprehensions
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-format
dependencyAdds
flake8-type-annotations
dependencyAdds
flake8-breaking-line
dependencyRemoves
flake8-super-call
dependencyAdds
PartialFloatViolation
Adds
MagicNumberViolation
Adds
WrongDocCommentViolation
Adds
MAGIC_NUMBERS_WHITELIST
constantChanges what variable names are blacklisted, adds
false
,true
, andno
Misc¶
Improves docs: now including docs for
--max-condition
optionImproves docs: adds some new
Zen of Python
referencesImproves 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
flake8
plugin dependencies are documented
Version 0.0.15¶
Features¶
Adds
MultipleIfsInComprehensionViolation
Adds
TooManyConditionsViolation
Adds
--max-conditions
option
Misc¶
Improves
CONTRIBUTING.md
Moves issues templates to
.github/
folder
Version 0.0.14¶
Features¶
Adds
WrongModuleNamePatternViolation
andWrongModuleNameUnderscoresViolation
Adds
TooManyImportsViolation
error and--max-imports
optionAdds
--i-control-code
option to ignoreInitModuleHasLogicViolation
Adds check for underscored numbers
Forbids
u''
stringsAdds
noqa
andtype
comments 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:
BaseTokenVisitor
for working withtokenize
Improves typing support
Adds
flake8-bandit
pluginAdds
flake8-eradicate
pluginAdds
flake8-print
plugin for developmentRemoves
delegate
concept from the codebase
Version 0.0.13 aka The Jones Complexity¶
Features¶
Adds
jones
complexity checkerAdds
--max-line-complexity
and--max-jones-score
options
Misc¶
Improves docs: adds detailed installation instructions
Removes
flake8-blind-except
plugin
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
BareRaiseViolation
as it does not fit the purpose of this package
Misc¶
Improves docs: now all errors are sorted by
code
Improves docs: now all errors have reasoning
Improves docs: some references are now clickable in web version
Improves docs: now docs include
CHANGELOG.md
Improves docs: now we have templates for
bug
andrule-request
Replaced
pytest-isort
withflake8-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/regression
Removed
compat.py
Fixes some minor typos, problems, markup inside the docs
Adds some new configuration to
sphinx
Changes
sphinx
docs structure a little bit
Version 0.0.10 aka The Module Reaper¶
Features¶
Adds
WrongModuleNameViolation
,WrongModuleMagicNameViolation
, andTooShortModuleNameViolation
Adds
--min-module-name-length
config optionAdds a blacklist of module names
Adds
InitModuleHasLogicsViolation
Adds
EmptyModuleViolation
Adds a whitelist of magic module names
Bugfixes¶
Fixes
Option
class to have have incorrecttype
field, now using stringsFixes that
WrongStringTokenVisitor
was 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
TooDeepNestingViolation
andTooManyElifsViolation
checksAdds
--max-offset-blocks
and--max-elifs
optionsAdds
TooManyModuleMembersViolation
andTooManyMethodsViolation
checksAdds
--max-module-members
and--max-methods
optionsRestricts to use
f
strings
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 inTooManyLocals
checkWe now restrict to nest
lambda
sWe 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
noqa
comment
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_stop
to be a__future__
importWe now restrict dotted raw imports like:
import os.path
We now check import aliases as regular variable names
Misc¶
We have added a
CONTRIBUTING.md
file to help new contributors
Version 0.0.4¶
Features¶
We now check
class
es to match our styleguideClasses have their own error group
Z3
Using
@staticmethod
is now forbiddenDeclaring
object
as a base class is now requiredNow we check that
__del__
magic method is not usedVariable names
async
andawait
are forbiddenWe now forbid to use
__future__
importsWe now have a whitelist for
__future__
importsImports are now have its own subgroup
Z10
General rules now start from
Z11
Version 0.0.3¶
Features¶
We now use
Z
as the default code for our errorsWe have shuffled errors around, changing code and formats
Now all name errors share the same class
Adds
PrivateNameViolation
Now imports inside any structures rather than
Module
raises an errorAdds
file
andklass
as restricted namesNow
__import__
is just a bad function name, not a special caseNow version is defined in
poetry.toml
onlyWe now have configuration! And it covers all design errors
Bugfixes¶
Fixes issue with missing
parent
s :batman:Fixes issue with
_$NAME
patterns 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:
decorator
andfactory
Adds new blacklisted module’s metadata variables
Removed
BAD_IMPORT_FUNCTIONS
variable, 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
poetry
as the main project toolAdds
shpinx
as a documentation tool
Version 0.0.1¶
Initial release