diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 683db02..7ebb28f 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -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/ 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