pytorch-lightning
/
.pre-commit-config.yaml
108 строк · 3.3 Кб
1# Copyright The Lightning AI team.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15default_language_version:
16python: python3
17
18ci:
19autofix_prs: true
20autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions"
21autoupdate_schedule: quarterly
22# submodules: true
23
24repos:
25- repo: https://github.com/pre-commit/pre-commit-hooks
26rev: v4.5.0
27hooks:
28- id: end-of-file-fixer
29- id: trailing-whitespace
30# keep formatting in README flexible
31exclude: README.md
32- id: check-json
33- id: check-yaml
34- id: check-toml
35- id: check-docstring-first
36- id: check-executables-have-shebangs
37- id: check-case-conflict
38- id: check-added-large-files
39args: ["--maxkb=350", "--enforce-all"]
40exclude: |
41(?x)^(
42docs/source-pytorch/_static/images/general/fast_2.gif|
43docs/source-pytorch/_static/images/mnist_imgs/pt_to_pl.jpg|
44docs/source-pytorch/_static/images/lightning_module/pt_to_pl.png|
45docs/source-pytorch/_static/images/general/pl_quick_start_full_compressed.gif|
46docs/source-pytorch/_static/images/general/pl_overview_flat.jpg|
47docs/source-pytorch/_static/images/general/pl_overview.gif|
48src/lightning/fabric/CHANGELOG.md|
49src/lightning/pytorch/CHANGELOG.md
50)$
51- id: detect-private-key
52
53- repo: https://github.com/asottile/pyupgrade
54rev: v3.15.0
55hooks:
56- id: pyupgrade
57args: ["--py38-plus"]
58name: Upgrade code
59
60- repo: https://github.com/codespell-project/codespell
61rev: v2.2.6
62hooks:
63- id: codespell
64additional_dependencies: [tomli]
65#args: ["--write-changes"] # uncomment if you want to get automatic fixing
66
67- repo: https://github.com/PyCQA/docformatter
68rev: v1.7.5
69hooks:
70- id: docformatter
71additional_dependencies: [tomli]
72args: ["--in-place"]
73
74- repo: https://github.com/sphinx-contrib/sphinx-lint
75rev: v0.9.1
76hooks:
77- id: sphinx-lint
78
79- repo: https://github.com/astral-sh/ruff-pre-commit
80rev: "v0.2.0"
81hooks:
82- id: ruff-format
83args: ["--preview"]
84- id: ruff
85args: ["--fix", "--preview"]
86
87- repo: https://github.com/executablebooks/mdformat
88rev: 0.7.17
89hooks:
90- id: mdformat
91additional_dependencies:
92- mdformat-gfm
93#- mdformat-black
94- mdformat_frontmatter
95exclude: |
96(?x)^(
97src/lightning/app/CHANGELOG.md|
98src/lightning/fabric/CHANGELOG.md|
99src/lightning/pytorch/CHANGELOG.md|
100README.md
101)$
102
103- repo: https://github.com/pre-commit/mirrors-prettier
104rev: v3.1.0
105hooks:
106- id: prettier
107# https://prettier.io/docs/en/options.html#print-width
108args: ["--print-width=120"]
109