From 9c3e9e0b39de4496b0afb015e50d67f15656791d Mon Sep 17 00:00:00 2001 From: UtkarshMishra-Microsoft Date: Tue, 3 Dec 2024 20:13:12 +0530 Subject: [PATCH] Add code quality workflow --- .flake8 | 31 +++++++++++++++++++++++++++++++ .github/workflows/pylint.yml | 0 .pylintrc | 31 +++++++++++++++++++++++++++++++ requirements.txt | 14 ++++++++++++-- 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 .flake8 create mode 100644 .github/workflows/pylint.yml create mode 100644 .pylintrc diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..9cc9cf2d --- /dev/null +++ b/.flake8 @@ -0,0 +1,31 @@ +[MESSAGES CONTROL] +# Disable certain warnings and errors +disable= + missing-docstring, # Missing docstrings + invalid-name, # Variable names not in snake_case + too-many-arguments, # Exceeding argument limits + too-many-locals, # Exceeding local variable limits + too-many-branches, # Complex functions + too-many-lines, # Exceeding file line limit + import-error, # Ignored unresolved imports + no-name-in-module, # Missing module names + broad-exception-raised, # Avoid broad exceptions + redefined-outer-name, # Outer variable shadowing + no-else-return, # Remove unnecessary else + unused-import, # Unused imports + +[FORMAT] +# Set the maximum line length +max-line-length=120 + +[DESIGN] +# Adjust thresholds for warnings +max-args=10 +max-locals=30 +max-branches=20 +max-lines=1500 +max-statements=100 + +[LOGGING] +# Disable logging format errors +logging-format-style=old \ No newline at end of file diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 00000000..e69de29b diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..9cc9cf2d --- /dev/null +++ b/.pylintrc @@ -0,0 +1,31 @@ +[MESSAGES CONTROL] +# Disable certain warnings and errors +disable= + missing-docstring, # Missing docstrings + invalid-name, # Variable names not in snake_case + too-many-arguments, # Exceeding argument limits + too-many-locals, # Exceeding local variable limits + too-many-branches, # Complex functions + too-many-lines, # Exceeding file line limit + import-error, # Ignored unresolved imports + no-name-in-module, # Missing module names + broad-exception-raised, # Avoid broad exceptions + redefined-outer-name, # Outer variable shadowing + no-else-return, # Remove unnecessary else + unused-import, # Unused imports + +[FORMAT] +# Set the maximum line length +max-line-length=120 + +[DESIGN] +# Adjust thresholds for warnings +max-args=10 +max-locals=30 +max-branches=20 +max-lines=1500 +max-statements=100 + +[LOGGING] +# Disable logging format errors +logging-format-style=old \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index abd09396..176d8e60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,18 @@ azure-search-documents==11.4.0b6 azure-storage-blob==12.17.0 python-dotenv==1.0.0 azure-cosmos==4.7.0 -quart==0.19.4 +quart==0.19.9 uvicorn==0.24.0 aiohttp==3.10.5 gunicorn==20.1.0 -pydantic-settings==2.2.1 \ No newline at end of file +pydantic-settings==2.2.1 + +# Development Tools +pylint==2.17.5 +autopep8==2.0.2 +black==23.9.1 +isort==5.12.0 +flake8==6.0.0 +pyment==0.3.3 +charset-normalizer==3.3.0 +pycodestyle==2.10.0 \ No newline at end of file