pytorch-lightning

Форк
0
/
.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

15
default_language_version:
16
  python: python3
17

18
ci:
19
  autofix_prs: true
20
  autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions"
21
  autoupdate_schedule: quarterly
22
  # submodules: true
23

24
repos:
25
  - repo: https://github.com/pre-commit/pre-commit-hooks
26
    rev: v4.5.0
27
    hooks:
28
      - id: end-of-file-fixer
29
      - id: trailing-whitespace
30
        # keep formatting in README flexible
31
        exclude: 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
39
        args: ["--maxkb=350", "--enforce-all"]
40
        exclude: |
41
          (?x)^(
42
              docs/source-pytorch/_static/images/general/fast_2.gif|
43
              docs/source-pytorch/_static/images/mnist_imgs/pt_to_pl.jpg|
44
              docs/source-pytorch/_static/images/lightning_module/pt_to_pl.png|
45
              docs/source-pytorch/_static/images/general/pl_quick_start_full_compressed.gif|
46
              docs/source-pytorch/_static/images/general/pl_overview_flat.jpg|
47
              docs/source-pytorch/_static/images/general/pl_overview.gif|
48
              src/lightning/fabric/CHANGELOG.md|
49
              src/lightning/pytorch/CHANGELOG.md
50
          )$
51
      - id: detect-private-key
52

53
  - repo: https://github.com/asottile/pyupgrade
54
    rev: v3.15.0
55
    hooks:
56
      - id: pyupgrade
57
        args: ["--py38-plus"]
58
        name: Upgrade code
59

60
  - repo: https://github.com/codespell-project/codespell
61
    rev: v2.2.6
62
    hooks:
63
      - id: codespell
64
        additional_dependencies: [tomli]
65
        #args: ["--write-changes"] # uncomment if you want to get automatic fixing
66

67
  - repo: https://github.com/PyCQA/docformatter
68
    rev: v1.7.5
69
    hooks:
70
      - id: docformatter
71
        additional_dependencies: [tomli]
72
        args: ["--in-place"]
73

74
  - repo: https://github.com/sphinx-contrib/sphinx-lint
75
    rev: v0.9.1
76
    hooks:
77
      - id: sphinx-lint
78

79
  - repo: https://github.com/astral-sh/ruff-pre-commit
80
    rev: "v0.2.0"
81
    hooks:
82
      - id: ruff-format
83
        args: ["--preview"]
84
      - id: ruff
85
        args: ["--fix", "--preview"]
86

87
  - repo: https://github.com/executablebooks/mdformat
88
    rev: 0.7.17
89
    hooks:
90
      - id: mdformat
91
        additional_dependencies:
92
          - mdformat-gfm
93
          #- mdformat-black
94
          - mdformat_frontmatter
95
        exclude: |
96
          (?x)^(
97
              src/lightning/app/CHANGELOG.md|
98
              src/lightning/fabric/CHANGELOG.md|
99
              src/lightning/pytorch/CHANGELOG.md|
100
              README.md
101
          )$
102

103
  - repo: https://github.com/pre-commit/mirrors-prettier
104
    rev: v3.1.0
105
    hooks:
106
      - id: prettier
107
        # https://prettier.io/docs/en/options.html#print-width
108
        args: ["--print-width=120"]
109

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.