Просмотр исходного кода

ci(pre-commit): Add rules for branch namimg

    Limit slashes in branch names
    No uppercase letters in branch names
Anton Maklakov 2 лет назад
Родитель
Сommit
af2f5dbd18
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      .pre-commit-config.yaml

+ 6 - 0
.pre-commit-config.yaml

@@ -28,6 +28,12 @@ repos:
       - id: mixed-line-ending
         args: ['-f=lf']
       - id: double-quote-string-fixer
+      - id: no-commit-to-branch
+        name: Do not use more than one slash in the branch name
+        args: ['--pattern', '^[^/]*/[^/]*/']
+      - id: no-commit-to-branch
+        name: Do not use uppercase letters in the branch name
+        args: ['--pattern', '^[^A-Z]*[A-Z]']
   - repo: https://github.com/PyCQA/flake8
     rev: 5.0.4
     hooks: