From 2cd861bdd3f802438505927f72525e9db1f296e7 Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 19 Jan 2023 10:41:26 -0500 Subject: [PATCH] disabled flake8 forcing comments to avoid all of the useless comments but still enforcing the formatting of comments if they exist w/ burnettk --- .flake8 | 7 +++++-- bin/run_pyl | 7 ------- spiffworkflow-backend/.flake8 | 7 +++++-- .../src/spiffworkflow_backend/routes/user.py | 1 - 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.flake8 b/.flake8 index d404e7fda..a35f75e0e 100644 --- a/.flake8 +++ b/.flake8 @@ -8,8 +8,11 @@ rst-roles = class,const,func,meth,mod,ref rst-directives = deprecated per-file-ignores = - # prefer naming tests descriptively rather than forcing comments - spiffworkflow-backend/tests/*:S101,D103 + # asserts are ok in tests + spiffworkflow-backend/tests/*:S101 + + # prefer naming functions descriptively rather than forcing comments + spiffworkflow-backend/*:D103 spiffworkflow-backend/bin/keycloak_test_server.py:B950,D spiffworkflow-backend/conftest.py:S105 diff --git a/bin/run_pyl b/bin/run_pyl index bceba187b..20953cb46 100755 --- a/bin/run_pyl +++ b/bin/run_pyl @@ -31,12 +31,6 @@ function get_python_dirs() { (git ls-tree -r HEAD --name-only | grep -E '\.py$' | awk -F '/' '{print $1}' | sort | uniq | grep -v '\.' | grep -Ev '^(bin|migrations)$') || echo '' } -function run_fix_docstrings() { - if command -v fix_python_docstrings >/dev/null ; then - fix_python_docstrings $(get_top_level_directories_containing_python_files) - fi -} - function run_autoflake() { # checking command -v autoflake8 is not good enough, since the asdf shim may be installed, which will make command -v succeed, # but autoflake8 may not have been pip installed inside the correct version of python. @@ -79,7 +73,6 @@ done for python_project in "${python_projects[@]}" ; do if [[ "$subcommand" != "pre" ]] || [[ -n "$(git status --porcelain "$python_project")" ]]; then pushd "$python_project" - run_fix_docstrings || run_fix_docstrings run_autoflake || run_autoflake popd fi diff --git a/spiffworkflow-backend/.flake8 b/spiffworkflow-backend/.flake8 index 1cc09c979..481ae8d32 100644 --- a/spiffworkflow-backend/.flake8 +++ b/spiffworkflow-backend/.flake8 @@ -8,8 +8,11 @@ rst-roles = class,const,func,meth,mod,ref rst-directives = deprecated per-file-ignores = - # prefer naming tests descriptively rather than forcing comments - tests/*:S101,D103 + # asserts are ok in tests + tests/*:S101 + + # prefer naming functions descriptively rather than forcing comments + *:D103 bin/keycloak_test_server.py:B950,D conftest.py:S105 diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py index 5a3aa53dc..9182d99fe 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py @@ -303,7 +303,6 @@ def login_api() -> Response: def login_api_return(code: str, state: str, session_state: str) -> str: - """Login_api_return.""" state_dict = ast.literal_eval(base64.b64decode(state).decode("utf-8")) state_dict["redirect_url"]