File size: 2,061 Bytes
37e760f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
repos:
  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 25.1.0 # Use the latest Black version
    hooks:
      - id: black
        args: ["--diff", "--line-length", "120"] # --check to Enforce check-only mode (no auto-formatting)
        types: [python] # Target Python files
        exclude: .*_pb2.*\.py

  - repo: https://github.com/Lucas-C/pre-commit-hooks
    rev: v1.5.5
    hooks:
      - id: insert-license
        files: \.py$
        args:
          # - "--remove-header" # Remove existing license headers. Useful when updating license.
          - "--license-filepath"
          - ".github/LICENSE_HEADER.txt"
          - "--use-current-year"
        exclude: |
          (?x)^(
              server/source/genie.sim.lab/genie/sim/lab/app/app_launcher.py|
              server/source/genie.sim.lab/genie/sim/lab/app/ui_builder.py|
              server/source/genie.sim.lab/genie/sim/lab/controllers/parallel_gripper.py|
              robot/isaac_sim/aimdk/
          )$


  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0 # Use the ref you want to point at
    hooks:
      - id: trailing-whitespace
      - id: check-added-large-files
      - id: check-ast
      - id: check-json
      - id: check-xml
      - id: check-yaml
      - id: requirements-txt-fixer
      - id: sort-simple-yaml
      - id: pretty-format-json
        args: [--autofix]
      - id: mixed-line-ending
      - id: detect-private-key
      - id: debug-statements
      - id: check-merge-conflict
      - id: check-docstring-first
      - id: check-byte-order-marker # Forbid UTF-8 byte-order markers
      - id: end-of-file-fixer

  # https://blogs.halodoc.io/code-version-best-practices-with-clean-commit-formats/
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v4.2.0
    hooks:
      - id: commitizen
        stages: [commit-msg]
        args:
          [
            --allowed-prefixes,
            "add,dev,chore,ci,perf,update,fix,feat,docs,refactor,revert,test,format",
            --min-length=10,
          ]