mirror of
https://github.com/libretro/scummvm.git
synced 2026-11-07 12:38:04 -10:00
JANITORIAL: add pre-commit yaml with clang-tidy
You can opt-in by install pre-commit, `pip install --upgrade pre-commit`, then run `pre-commit install` in scummvm directory.
This commit is contained in:
1 parent
33cdefbfed
commit
5aaf476b73
3 files changed
+42
-1
No files matched your search
+1
-1
@@ -19,5 +19,5 @@
|
||||
SpacesInAngles: false,
|
||||
SpacesInParentheses: false,
|
||||
SpacesInSquareBrackets: false,
|
||||
Standard: c++03,
|
||||
Standard: c++11,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v21.1.2
|
||||
hooks:
|
||||
- id: clang-format
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: check-commit-msg
|
||||
name: check-commit-msg
|
||||
language: python
|
||||
entry: devtools/check-commit-msg.py
|
||||
stages: [ commit-msg ]
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
from argparse import ArgumentParser
|
||||
|
||||
parser = ArgumentParser(description="SCUMMVM check commit message hook")
|
||||
parser.add_argument("message")
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.message, "rt") as f:
|
||||
text = f.read()
|
||||
|
||||
MESSAGE_FORMAT = re.compile(r"[A-Z_]+:")
|
||||
|
||||
if MESSAGE_FORMAT.match(text):
|
||||
sys.exit(0)
|
||||
|
||||
print("Please start your commit message with subsystem or engine name written in CAPS", file=sys.stderr)
|
||||
print("See https://wiki.scummvm.org/index.php/Commit_Guidelines", file=sys.stderr)
|
||||
print("Your original message follows:\n\n", text)
|
||||
sys.exit(1)
|
||||
Reference in new issue
Block a user