From 8c427f1bf2aaddf92a2169abfb276a96d167cc4b Mon Sep 17 00:00:00 2001 From: "TeranGmoravian.edu" Date: Wed, 16 Apr 2025 12:58:28 -0400 Subject: [PATCH 1/3] workflow --- .github/workflows/linting.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 683db02..9366609 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,4 +1,4 @@ -name: linter_tests +name: code_quality on: pull_request: @@ -23,12 +23,14 @@ jobs: python-version: '3.13' - name: Install dependencies - run: python -m pip install --upgrade pip pylint - - - name: Run Pylint - run: pylint --rcfile=tests/.pylintrc $(find tests -name "*.py") - + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Run Pylint on application code + run: pylint --rcfile=tests/.pylintrc endpoints/ + - name: Run Pylint on tests + run: pylint --rcfile=tests/.pylintrc tests/ From 963107c0703334204ded3ab18e5fdca5bc7e5618 Mon Sep 17 00:00:00 2001 From: "TeranGmoravian.edu" Date: Wed, 16 Apr 2025 12:59:05 -0400 Subject: [PATCH 2/3] better linting --- tests/.pylintrc | 68 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/tests/.pylintrc b/tests/.pylintrc index 969cf96..a05b427 100644 --- a/tests/.pylintrc +++ b/tests/.pylintrc @@ -2,6 +2,16 @@ # Set the Python version py-version=3.13 +# Specify pickle analysis path +persistent=yes +limit-inference-results=100 + +# Add ability to load C extensions for analysis +extension-pkg-whitelist=boto3,psycopg + +# Parallelize analysis for faster runs +jobs=0 + [MESSAGES CONTROL] disable= invalid-name, @@ -11,24 +21,70 @@ disable= too-many-branches, too-many-statements, too-many-instance-attributes, + missing-module-docstring, + missing-function-docstring, + fixme, + line-too-long, + +# Re-enable some important checks +enable= + unused-import, + unused-variable, + undefined-variable, + syntax-error, + dangerous-default-value [BASIC] -good-names=i,j,k,x,y,z,_ +# Good variable names which should always be accepted +good-names=i,j,k,x,y,z,e,_,id,db,fp,fn + +# Regular expression which should match good variable names +variable-rgx=[a-z_][a-z0-9_]{0,30}$ + +# Regular expression which should match good class names +class-rgx=[A-Z_][a-zA-Z0-9_]+$ + +# Regular expression which should match good function names +function-rgx=[a-z_][a-z0-9_]{0,30}$ [FORMAT] # Set max line length to a loose standard -max-line-length=200 +max-line-length=100 + +# Check string quote consistency +string-quote=single +triple-quote=double +docstring-quote=double [DESIGN] # Allow higher complexity before warnings -max-attributes=10 +max-attributes=12 max-args=10 -max-locals=20 +max-locals=25 max-returns=10 -max-branches=15 -max-statements=50 +max-branches=20 +max-statements=60 +max-complexity=15 [TYPECHECK] disable= no-member, no-self-use + +# Generated members that we don't want to check +generated-members=REQUEST,acl_users,aq_parent,objects,DoesNotExist,id,pk + +[SIMILARITIES] +# Minimum lines number of a similarity +min-similarity-lines=10 + +# Ignore imports when computing similarities +ignore-imports=yes + +[LOGGING] +# Format style of string formatting +logging-format-style=new + +[IMPORTS] +# Deprecated modules to warn about +deprecated-modules=optparse,tkinter.tix From 85c28f46c1e188bd3e7377e04c3a06bd2af65a64 Mon Sep 17 00:00:00 2001 From: "TeranGmoravian.edu" Date: Wed, 16 Apr 2025 13:30:36 -0400 Subject: [PATCH 3/3] rename --- .github/workflows/linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 9366609..7ebb28f 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,4 +1,4 @@ -name: code_quality +name: linter_tests on: pull_request: