|
| 1 | +# Ensure this configuration aligns with format.sh and requirements.txt |
| 2 | +repos: |
| 3 | +- repo: https://github.com/pre-commit/pre-commit-hooks |
| 4 | + rev: v5.0.0 |
| 5 | + hooks: |
| 6 | + - id: trailing-whitespace |
| 7 | + - id: end-of-file-fixer |
| 8 | + - id: check-yaml |
| 9 | + - id: check-added-large-files |
| 10 | + |
| 11 | +- repo: https://github.com/psf/black |
| 12 | + rev: 22.10.0 # Match the version from requirements |
| 13 | + hooks: |
| 14 | + - id: black |
| 15 | + name: black (IBM specific) |
| 16 | + files: "^sky/skylet/providers/ibm/.*" # Match only files in the IBM directory |
| 17 | + |
| 18 | +- repo: https://github.com/pycqa/isort |
| 19 | + rev: 5.12.0 # Match the version from requirements |
| 20 | + hooks: |
| 21 | + # First isort command |
| 22 | + - id: isort |
| 23 | + name: isort (general) |
| 24 | + args: |
| 25 | + - "--sg=build/**" # Matches "${ISORT_YAPF_EXCLUDES[@]}" |
| 26 | + - "--sg=sky/skylet/providers/ibm/**" |
| 27 | + files: "^(sky|tests|examples|llm|docs)/.*" # Only match these directories |
| 28 | + # Second isort command |
| 29 | + - id: isort |
| 30 | + name: isort (IBM specific) |
| 31 | + args: |
| 32 | + - "--profile=black" |
| 33 | + - "-l=88" |
| 34 | + - "-m=3" |
| 35 | + files: "^sky/skylet/providers/ibm/.*" # Only match IBM-specific directory |
| 36 | + |
| 37 | +- repo: https://github.com/pre-commit/mirrors-mypy |
| 38 | + rev: v0.991 # Match the version from requirements |
| 39 | + hooks: |
| 40 | + - id: mypy |
| 41 | + args: |
| 42 | + # From tests/mypy_files.txt |
| 43 | + - "sky" |
| 44 | + - "--exclude" |
| 45 | + - "sky/benchmark|sky/callbacks|sky/skylet/providers/azure|sky/resources.py|sky/backends/monkey_patches" |
| 46 | + pass_filenames: false |
| 47 | + additional_dependencies: |
| 48 | + - types-PyYAML |
| 49 | + - types-requests<2.31 # Match the condition in requirements.txt |
| 50 | + - types-setuptools |
| 51 | + - types-cachetools |
| 52 | + - types-pyvmomi |
| 53 | + |
| 54 | +- repo: https://github.com/google/yapf |
| 55 | + rev: v0.32.0 # Match the version from requirements |
| 56 | + hooks: |
| 57 | + - id: yapf |
| 58 | + name: yapf |
| 59 | + exclude: (build/.*|sky/skylet/providers/ibm/.*) # Matches exclusions from the script |
| 60 | + args: ['--recursive', '--parallel'] # Only necessary flags |
| 61 | + additional_dependencies: [toml==0.10.2] |
| 62 | + |
| 63 | +- repo: https://github.com/pylint-dev/pylint |
| 64 | + rev: v2.14.5 # Match the version from requirements |
| 65 | + hooks: |
| 66 | + - id: pylint |
| 67 | + additional_dependencies: |
| 68 | + - pylint-quotes==0.2.3 # Match the version from requirements |
| 69 | + name: pylint |
| 70 | + args: |
| 71 | + - --rcfile=.pylintrc # Use your custom pylint configuration |
| 72 | + - --load-plugins=pylint_quotes # Load the pylint-quotes plugin |
| 73 | + files: ^sky/ # Only include files from the 'sky/' directory |
| 74 | + exclude: ^sky/skylet/providers/ibm/ |
0 commit comments