Я пытаюсь настроить рабочий процесс GitHub Actions (определение ниже), проверяющий требования pylint. Я исправил все это на своей локальной машине. Затем я заметил, что в рабочем процессе появляется слишком много позиционных аргументов. Но моя локальная машина не знает этой конкретной ошибки.
Теперь я попытался исправить это с помощью pylint:disable=too-many-positional-arguments. В результате возникает следующая ошибка пилинта.
usc_sign_in_bot/db_helpers.py:345:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-argument' (unknown-option-value)
Кроме того, добавление сообщения об ошибке R0917 в .pylintrc (также определено ниже) не помогает, поскольку просто появляется локальная ошибка о том, что сообщение не известно отключить.
И на github, и на local установлен pylint==3.3.1.
Я думаю, что это какое-то несоответствие версий, но я не уверен, как это произойдет, поскольку обе версии pylint одинаковы и используют один и тот же .pylintrc. Кто-нибудь знает, откуда такое несоответствие?
.github/workflows/pylint:
name: pylint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
pip install pytest pylint==3.3.1
- name: Analysing the code with pylint
run: |
pylint usc_sign_in_bot/
pylint tests/
.pylintrc:
[MAIN]
# Specify a configuration file.
load-plugins=pylint.extensions.docstyle
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use.
jobs=0
# Specify a score threshold to be exceeded before program exits with error.
fail-under=10.0
[MESSAGES CONTROL]
# Disable the message, report, category or checker with the given id(s).
disable=C0199,E0401,E0611
# Disable the score feature, we want it right
score=no
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
[DESIGN]
# Maximum number of arguments for function / method.
max-args=10
[DOCSTRING]
# Require all classes and methods to have a docstring.
docstring-min-length=10
[CONVENTION]
# Ensure docstrings are present for all modules, classes, methods, and functions.
good-names=i,j,k,ex,Run,_
[REPORTS]
# Tweak the output format. You can have a full report with `yes`.
reports=no
[TYPECHECK]
generated-members=numpy.*,torch.*
[EXCEPTIONS]
# This option represents a list of qualified names for which no member or method should be checked.
ignored-classes=NotImplementedError
Подробнее здесь: https://stackoverflow.com/questions/790 ... error-on-t
«слишком много позиционных аргументов» на одной машине, но не знает об ошибке на локальной машине ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение