Pylint ignore rules on git action
Question:
I’ve used the default pylint from git actions
to check my project for any errors.
There are some errors that I want to ignore though. If it was in vscode you could ignore them in settings.json
. How do I ignore them in git actions
?
name: Pylint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- 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
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
Answers:
- you could use noqa comments for ignore specific lines
- you can run probably pylint with option disable or something like that:
pylint -d C0114,C0116 $(git ls-files '*.py')
this would disable warnings with the codes C0114
and C0116
I’ve used the default pylint from git actions
to check my project for any errors.
There are some errors that I want to ignore though. If it was in vscode you could ignore them in settings.json
. How do I ignore them in git actions
?
name: Pylint
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- 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
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- you could use noqa comments for ignore specific lines
- you can run probably pylint with option disable or something like that:
pylint -d C0114,C0116 $(git ls-files '*.py')
this would disable warnings with the codes C0114
and C0116