Version history¶
We follow Semantic Versions since the 0.1.0 release.
We used to have incremental versioning before 0.1.0.
0.7.1¶
Bugfixes¶
- Allows
Generic[SomeType]to be a valid superclass - Forces 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 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.0¶
Features¶
- Adds
flake8-per-file-ignoreplugin dependency - 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
0.5.1¶
Bugfixes¶
- Fixes all possible errors that happen
because of unset
parentandfunction_typeproperties
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
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 - Restrict unicode names
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
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
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 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
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-formatdependency - Adds
flake8-type-annotationsdependency - Adds
flake8-breaking-linedependency - Removes
flake8-super-calldependency - Adds
PartialFloatViolation - Adds
MagicNumberViolation - Adds
WrongDocCommentViolation - Adds
MAGIC_NUMBERS_WHITELISTconstant - Changes what variable names are blacklisted, adds
false,true, andno
Misc¶
- Improves docs: now including docs for
--max-conditionoption - Improves docs: adds some new
Zen of Pythonreferences - Improves 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
MultipleIfsInComprehensionViolation - Adds
TooManyConditionsViolation - Adds
--max-conditionsoption
Misc¶
- Improves
CONTRIBUTING.md - Moves issues templates to
.github/folder
Version 0.0.14¶
Features¶
- Adds
WrongModuleNamePatternViolationandWrongModuleNameUnderscoresViolation - Adds
TooManyImportsViolationerror and--max-importsoption - Adds
--i-control-codeoption to ignoreInitModuleHasLogicViolation - Adds check for underscored numbers
- Forbids
u''strings - Adds
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 withtokenize - Improves typing support
- Adds
flake8-banditplugin - Adds
flake8-eradicateplugin - Adds
flake8-printplugin for development - Removes
delegateconcept from the codebase
Version 0.0.13 aka The Jones Complexity¶
Features¶
- Adds
jonescomplexity checker - Adds
--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
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
bugandrule-request - Replaced
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/regression - Removed
compat.py - Fixes some minor typos, problems, markup inside the docs
- Adds some new configuration to
sphinx - Changes
sphinxdocs structure a little bit
Version 0.0.10 aka The Module Reaper¶
Features¶
- Adds
WrongModuleNameViolation,WrongModuleMagicNameViolation, andTooShortModuleNameViolation - Adds
--min-module-name-lengthconfig option - Adds a blacklist of module names
- Adds
InitModuleHasLogicsViolation - Adds
EmptyModuleViolation - Adds a whitelist of magic module names
Bugfixes¶
- Fixes
Optionclass to have have incorrecttypefield, now using strings - Fixes 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'error - Fixes
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
TooDeepNestingViolationandTooManyElifsViolationchecks - Adds
--max-offset-blocksand--max-elifsoptions - Adds
TooManyModuleMembersViolationandTooManyMethodsViolationchecks - Adds
--max-module-membersand--max-methodsoptions - Restricts to use
fstrings
Bugfixes¶
- Removes incorrect
generic_visit()calls - Removes some unused
getattr()calls - Refactors 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 inTooManyLocalscheck - We now restrict to nest
lambdas - We 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 raise - Changed 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__import - We now restrict dotted raw imports like:
import os.path - We 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 styleguide - Classes have their own error group
Z3 - Using
@staticmethodis now forbidden - Declaring
objectas a base class is now required - Now we check that
__del__magic method is not used - Variable names
asyncandawaitare forbidden - We now forbid to use
__future__imports - We now have a whitelist for
__future__imports - Imports are now have its own subgroup
Z10 - General rules now start from
Z11
Version 0.0.3¶
Features¶
- We now use
Zas the default code for our errors - We 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
Moduleraises an error - Adds
fileandklassas restricted names - Now
__import__is just a bad function name, not a special case - Now version is defined in
poetry.tomlonly - We 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:
decoratorandfactory - Adds 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 tool - Adds
shpinxas a documentation tool
Version 0.0.1¶
- Initial release