Skip to content

Commit

Permalink
Add pylint (#2008)
Browse files Browse the repository at this point in the history
Fixes #2001.
  • Loading branch information
pbchekin authored Aug 29, 2024
1 parent 6c7fafb commit 34824dc
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,64 @@ repos:
args: ["--fix", "--line-length", "120"]
stages: [commit, push, manual]

- repo: https://github.com/pycqa/pylint
rev: v3.2.6
hooks:
- id: pylint
name: pylint for scripts
files: '^scripts/.*\.py$'
# FIXME: will be deleted soon
exclude: '^scripts/create-noop-ipex\.py$'
args:
# Max line length 120 is consistent with ruff's one in upstream
- --max-line-length=120
# Disable line-too-long: rely on ruff's check for line length
- --disable=line-too-long
# Disable import-error: not everything can be imported when pre-commit runs
- --disable=import-error
# Disable unused-import: ruff has a corresponding check and supports "noqa: F401"
- --disable=unused-import
# FIXME: revisit these checks later
- --disable=missing-module-docstring
- --disable=missing-function-docstring
- --disable=missing-class-docstring
- --disable=duplicate-code
- --disable=too-many-locals
- --disable=too-many-statements
- --disable=too-many-arguments
stages: [commit, push, manual]

- id: pylint
name: pylint for benchmarks
files: '^benchmarks/.*\.py$'
args:
# Max line length 120 is consistent with ruff's one in upstream
- --max-line-length=120
# Disable line-too-long: rely on ruff's check for line length
- --disable=line-too-long
# Disable import-error: not everything can be imported when pre-commit runs
- --disable=import-error
# Disable unused-import: ruff has a corresponding check and supports "noqa: F401"
- --disable=unused-import
# Disable invalid_name: benchmarks use a lot of UPPER_SNAKE arguments
- --disable=invalid-name
# Disable unnecessary-lambda-assignment: benchmark use a lot of lambda assignments
- --disable=unnecessary-lambda-assignment
# FIXME: revisit these checks later
- --disable=import-outside-toplevel
- --disable=too-few-public-methods
- --disable=consider-using-generator
- --disable=missing-module-docstring
- --disable=missing-function-docstring
- --disable=missing-class-docstring
- --disable=duplicate-code
- --disable=too-many-locals
- --disable=too-many-statements
- --disable=too-many-arguments
- --disable=fixme
stages: [commit, push, manual]


exclude: |
(?x)(
^include/triton/external/|
Expand Down

0 comments on commit 34824dc

Please sign in to comment.