From 8767db36ec0ed993b2377623b6da2b6b10ca0d8b Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 4 Oct 2018 21:40:09 +0300 Subject: [PATCH] Version 0.2.0 release --- CHANGELOG.md | 13 ++++++++++++- pyproject.toml | 2 +- .../violations/best_practices.py | 2 +- .../visitors/ast/complexity/nested.py | 4 ---- wemake_python_styleguide/visitors/ast/strings.py | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eab30de2..197f8bcd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,16 @@ We follow Semantic Versions since the `0.1.0` release. We used to have incremental versioning before `0.1.0`. -## WIP +## 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: + +- [@novikovfred](https://github.com/novikovfred) +- [@AlwxSin](https://github.com/AlwxSin) +- [@TyVik](https://github.com/TyVik) +- [@AlexArcPy](https://github.com/AlexArcPy) +- [@tommbee](https://github.com/tommbee) ### Features @@ -17,6 +26,8 @@ We used to have incremental versioning before `0.1.0`. - We now check `async` functions names and arguments - We now count `async` functions complexity - We now ignore `async` functions in jones complexity check +- We now check for nested `async` functions +- We now check for `async` functions with `@staticmethod` decorator ### Misc diff --git a/pyproject.toml b/pyproject.toml index 5bd9b747d..9d7fc1392 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wemake-python-styleguide" -version = "0.1.0" +version = "0.2.0" description = "The most opinionated linter ever, used by wemake.services" license = "MIT" diff --git a/wemake_python_styleguide/violations/best_practices.py b/wemake_python_styleguide/violations/best_practices.py index 4f428cb5f..4fee83bee 100644 --- a/wemake_python_styleguide/violations/best_practices.py +++ b/wemake_python_styleguide/violations/best_practices.py @@ -392,7 +392,7 @@ class NestedFunctionViolation(ASTViolation): Pass parameters as normal arguments, do not use closures. Until you need them for decorators or factories. - We also disallow to nest ``lambda`` functions. + We also disallow to nest ``lambda`` and ``async`` functions. See :py:data:`~wemake_python_styleguide.constants.NESTED_FUNCTIONS_WHITELIST` diff --git a/wemake_python_styleguide/visitors/ast/complexity/nested.py b/wemake_python_styleguide/visitors/ast/complexity/nested.py index 3e3cbc063..653d20196 100644 --- a/wemake_python_styleguide/visitors/ast/complexity/nested.py +++ b/wemake_python_styleguide/visitors/ast/complexity/nested.py @@ -74,10 +74,6 @@ def visit_any_function(self, node: AnyFunctionDef) -> None: Used to find nested functions. Uses ``NESTED_FUNCTIONS_WHITELIST`` to respect some nested functions. - Respected usecases for nested functions: - - 1. decorator - 2. factory function Raises: NestedFunctionViolation diff --git a/wemake_python_styleguide/visitors/ast/strings.py b/wemake_python_styleguide/visitors/ast/strings.py index 3e207f3e5..5fc6bcdba 100644 --- a/wemake_python_styleguide/visitors/ast/strings.py +++ b/wemake_python_styleguide/visitors/ast/strings.py @@ -7,11 +7,11 @@ class WrongStringVisitor(BaseNodeVisitor): - """Restricts to use `f` strings.""" + """Restricts to use ``f`` strings.""" def visit_JoinedStr(self, node) -> None: # type is not defined in ast yet """ - Restricts to use `f` strings. + Restricts to use ``f`` strings. Raises: FormattedStringViolation