Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pylint ignore rules on git action

Tags:

python

pylint

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')
like image 965
haduki Avatar asked Oct 19 '25 12:10

haduki


1 Answers

  1. you could use noqa comments for ignore specific lines
  2. 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

like image 118
Ruslan Korneev Avatar answered Oct 21 '25 04:10

Ruslan Korneev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!