From 9894063fe9a8b551a5fc027326331bd5ba9a9168 Mon Sep 17 00:00:00 2001 From: Eric Young Date: Tue, 27 Apr 2021 13:51:30 +0100 Subject: [PATCH] Remove flake8 F401 exclusion for `__init__.py` files Instead declare the `__all__` variable as stated by flake8's maintainer: https://stackoverflow.com/a/59438802 --- .flake8 | 1 - hooks/__init__.py | 1 + {{ cookiecutter.repo_name }}/.flake8 | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 617af20..fa8c8df 100644 --- a/.flake8 +++ b/.flake8 @@ -6,4 +6,3 @@ exclude = venv*,__pycache__,node_modules,bower_components,migrations ignore = D203,W503 max-complexity = 9 max-line-length = 120 -per-file-ignores = __init__.py:F401 diff --git a/hooks/__init__.py b/hooks/__init__.py index 83322cc..74050b2 100644 --- a/hooks/__init__.py +++ b/hooks/__init__.py @@ -1,2 +1,3 @@ from hooks.post_gen_project import remove_folder, set_aqa_framework, set_request_template from hooks.pre_gen_project import check_valid_email_address_format +__all__ = ("check_valid_email_address_format", "remove_folder", "set_aqa_framework", "set_request_template", ) diff --git a/{{ cookiecutter.repo_name }}/.flake8 b/{{ cookiecutter.repo_name }}/.flake8 index 617af20..fa8c8df 100644 --- a/{{ cookiecutter.repo_name }}/.flake8 +++ b/{{ cookiecutter.repo_name }}/.flake8 @@ -6,4 +6,3 @@ exclude = venv*,__pycache__,node_modules,bower_components,migrations ignore = D203,W503 max-complexity = 9 max-line-length = 120 -per-file-ignores = __init__.py:F401