Skip to content

Commit

Permalink
fix the pylint hook for pre-commit (#4422)
Browse files Browse the repository at this point in the history
* fix the pylint hook

* remove default arg

* change name

* limit pylint files
  • Loading branch information
zpoint authored Nov 27, 2024
1 parent c3223a4 commit 23f9821
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,9 @@ repos:
- id: pylint
additional_dependencies:
- pylint-quotes==0.2.3 # Match the version from requirements
name: pylint-only-changed-files
entry: >
bash -c '
MERGEBASE=$(git merge-base origin/main HEAD);
changed_files=$(git diff --name-only --diff-filter=ACM "$MERGEBASE" -- "sky/*.py" "sky/*.pyi");
if [[ -n "$changed_files" ]]; then
echo "$changed_files" | tr "\n" "\0" | xargs -0 pylint --load-plugins=pylint_quotes --rcfile=.pylintrc;
else
echo "Pylint skipped: no files changed in sky/.";
fi'
pass_filenames: false
always_run: true
name: pylint
args:
- --rcfile=.pylintrc # Use your custom pylint configuration
- --load-plugins=pylint_quotes # Load the pylint-quotes plugin
files: ^sky/ # Only include files from the 'sky/' directory
exclude: ^sky/skylet/providers/ibm/

0 comments on commit 23f9821

Please sign in to comment.