From 276f430b57957771f23355a6a1eb10a55899a677 Mon Sep 17 00:00:00 2001 From: danieleades <33452915+danieleades@users.noreply.github.com> Date: Tue, 20 Sep 2022 21:30:31 +0100 Subject: [PATCH] Begin addding `flake8-simplify` checks (#10820) Start with SIM104 and ignore all other flake8-simplify warnings --- doc/development/tutorials/examples/recipe.py | 3 +-- pyproject.toml | 1 + setup.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/development/tutorials/examples/recipe.py b/doc/development/tutorials/examples/recipe.py index f917f15c9..8dc53fdd6 100644 --- a/doc/development/tutorials/examples/recipe.py +++ b/doc/development/tutorials/examples/recipe.py @@ -120,8 +120,7 @@ class RecipeDomain(Domain): return '{}.{}'.format('recipe', node.arguments[0]) def get_objects(self): - for obj in self.data['recipes']: - yield obj + yield from self.data['recipes'] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): diff --git a/pyproject.toml b/pyproject.toml index 7cc05fc22..850d9a28d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,7 @@ lint = [ "flake8>=3.5.0", "flake8-comprehensions", "flake8-bugbear", + "flake8-simplify", "isort", "mypy>=0.971", "sphinx-lint", diff --git a/setup.cfg b/setup.cfg index c524c3c56..5af3b6576 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [flake8] max-line-length = 95 -ignore = E116,E241,E251,E741,W504,I101,B006,B023 +ignore = E116,E241,E251,E741,W504,I101,B006,B023,SIM102,SIM103,SIM105,SIM110,SIM113,SIM114,SIM115,SIM117,SIM223,SIM300,SIM401,SIM904,SIM905,SIM907 exclude = .git,.tox,.venv,tests/roots/*,build/*,doc/_build/*,sphinx/search/*,doc/usage/extensions/example*.py application-import-names = sphinx import-order-style = smarkets