From 076735cbb0f84185e06cda1bc79882b95633660f Mon Sep 17 00:00:00 2001 From: Dpeta <69427753+Dpeta@users.noreply.github.com> Date: Mon, 13 Feb 2023 02:02:19 +0100 Subject: [PATCH] Add pylint workflow --- .github/workflows/black.yml | 4 +--- .github/workflows/pylint.yml | 20 ++++++++++++++++++++ .pylintrc | 33 +++++++++++++-------------------- pnc/lexercon.py | 2 +- 4 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index a9be522..89d3c25 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -1,7 +1,5 @@ name: Black - -on: [push, pull_request] - +on: push jobs: black: runs-on: ubuntu-latest diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..9856069 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,20 @@ +name: Pylint +on: push +jobs: + pylint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Python 3.10 x64 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + architecture: 'x64' + - name: Install Dependencies + run: python3 -m pip install PyQt6 certifi PyInstaller + - name: Install Pylint + run: python3 -m pip install --pre pylint + - name: Run Pylint + run: | + cd .. + PYLINTRC=pesterchum-alt-servers/.pylintrc python -m pylint --recursive=y pesterchum-alt-servers diff --git a/.pylintrc b/.pylintrc index 55d8912..7b533cd 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,7 +11,7 @@ analyse-fallback-blocks=no # In error mode, checkers without error messages are disabled and for others, # only the ERROR messages are displayed, and no reports are done by default. -#errors-only= +errors-only= # Always return a 0 (non-error) status code, even if lint errors are found. # This is primarily useful in continuous integration scripts. @@ -31,10 +31,10 @@ extension-pkg-whitelist= # Return non-zero exit code if any of these messages/categories are detected, # even if score is above --fail-under value. Syntax same as enable. Messages # specified are enabled, while categories only check already-enabled messages. -fail-on= +fail-on=E,F # Specify a score threshold to be exceeded before program exits with error. -fail-under=6.5 +#fail-under=6 # Interpret the stdin as a python script, whose filename needs to be passed as # the module_or_package argument. @@ -80,7 +80,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.10 +py-version=3.8 # Discover python modules and packages in the file system subtree. recursive=no @@ -119,7 +119,7 @@ msg-template= reports=yes # Activate the evaluation score. -score=yes +score=no [MESSAGES CONTROL] @@ -142,20 +142,13 @@ confidence=HIGH, # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=raw-checker-failed, - bad-inline-option, - locally-disabled, - file-ignored, - suppressed-message, - useless-suppression, - deprecated-pragma, - use-symbolic-message-instead +#disable=all # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member +#enable=F,E,W [CLASSES] @@ -164,10 +157,10 @@ enable=c-extension-no-member check-protected-access-in-special-methods=no # List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp, - __post_init__ +#defining-attr-methods=__init__, +# __new__, +# setUp, +# __post_init__ # List of member names, which should be excluded from the protected access # warning. @@ -270,8 +263,8 @@ min-similarity-lines=4 [EXCEPTIONS] # Exceptions that will emit a warning when caught. -overgeneral-exceptions=BaseException, - Exception +#overgeneral-exceptions=BaseException, +# Exception [MISCELLANEOUS] diff --git a/pnc/lexercon.py b/pnc/lexercon.py index 6112af8..d87dbaf 100644 --- a/pnc/lexercon.py +++ b/pnc/lexercon.py @@ -1,4 +1,4 @@ -from .unicolor import Color +from pnc.unicolor import Color import re