.pre-commit-config.yaml 2.64 KB
Newer Older
Ezra-Yu's avatar
Ezra-Yu committed
1
2
3
4
exclude: |
    (?x)^(
      tests/data/|
      opencompass/models/internal/|
5
      opencompass/utils/internal/|
Leymore's avatar
Leymore committed
6
7
      opencompass/openicl/icl_evaluator/hf_metrics/|
      opencompass/datasets/lawbench/utils|
Xiaoming Shi's avatar
Xiaoming Shi committed
8
      opencompass/datasets/lawbench/evaluation_functions/|
9
      opencompass/datasets/medbench/|
Skyfall-xzz's avatar
Skyfall-xzz committed
10
      opencompass/datasets/NPHardEval/|
11
      docs/zh_cn/advanced_guides/compassbench_intro.md
Ezra-Yu's avatar
Ezra-Yu committed
12
13
14
15
16
17
    )
repos:
  - repo: https://github.com/PyCQA/flake8
    rev: 5.0.4
    hooks:
      - id: flake8
18
        exclude: configs/
Ezra-Yu's avatar
Ezra-Yu committed
19
20
21
22
  - repo: https://github.com/PyCQA/isort
    rev: 5.11.5
    hooks:
      - id: isort
23
        exclude: configs/
Ezra-Yu's avatar
Ezra-Yu committed
24
25
26
27
  - repo: https://github.com/pre-commit/mirrors-yapf
    rev: v0.32.0
    hooks:
      - id: yapf
28
        exclude: configs/
Ezra-Yu's avatar
Ezra-Yu committed
29
30
31
32
  - repo: https://github.com/codespell-project/codespell
    rev: v2.2.1
    hooks:
      - id: codespell
33
        exclude: |
philipwangOvO's avatar
philipwangOvO committed
34
            (?x)^(
35
36
37
                .*\.jsonl|
                configs/
            )
Ezra-Yu's avatar
Ezra-Yu committed
38
39
40
41
42
43
44
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
      - id: trailing-whitespace
        exclude: |
            (?x)^(
              dicts/|
45
46
              projects/.*?/dicts/|
              configs/
Ezra-Yu's avatar
Ezra-Yu committed
47
48
49
50
51
52
            )
      - id: check-yaml
      - id: end-of-file-fixer
        exclude: |
            (?x)^(
              dicts/|
53
54
              projects/.*?/dicts/|
              configs/
Ezra-Yu's avatar
Ezra-Yu committed
55
56
57
            )
      - id: requirements-txt-fixer
      - id: double-quote-string-fixer
58
        exclude: configs/
Ezra-Yu's avatar
Ezra-Yu committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
      - id: check-merge-conflict
      - id: fix-encoding-pragma
        args: ["--remove"]
      - id: mixed-line-ending
        args: ["--fix=lf"]
      - id: mixed-line-ending
        args: ["--fix=lf"]
  - repo: https://github.com/executablebooks/mdformat
    rev: 0.7.9
    hooks:
      - id: mdformat
        args: ["--number", "--table-width", "200"]
        additional_dependencies:
          - mdformat-openmmlab
          - mdformat_frontmatter
          - linkify-it-py
75
        exclude: configs/
Ezra-Yu's avatar
Ezra-Yu committed
76
77
78
79
80
  - repo: https://github.com/myint/docformatter
    rev: v1.3.1
    hooks:
      - id: docformatter
        args: ["--in-place", "--wrap-descriptions", "79"]
81
82
83
84
85
86
87
88
89
  - repo: local
    hooks:
    -   id: update-dataset-suffix
        name: dataset suffix updater
        entry: ./tools/update_dataset_suffix.py
        language: script
        pass_filenames: true
        require_serial: true
        files: ^configs/datasets
Ezra-Yu's avatar
Ezra-Yu committed
90
91
92
93
94
95
  # - repo: https://github.com/open-mmlab/pre-commit-hooks
  #   rev: v0.2.0  # Use the ref you want to point at
  #   hooks:
  #     - id: check-algo-readme
      # - id: check-copyright
      #   args: ["mmocr", "tests", "tools"]  # these directories will be checked