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