feat: add pre-commit and initial justfile
This commit is contained in:
18
.pre-commit-config.yaml
Normal file
18
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
exclude: '^(qmk_upstream/|qmk_framework/|\.build/)'
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-json
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
|
rev: v18.1.8
|
||||||
|
hooks:
|
||||||
|
- id: clang-format
|
||||||
|
types_or: [c, c++]
|
||||||
20
justfile
Normal file
20
justfile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
[private]
|
||||||
|
default:
|
||||||
|
@just --list
|
||||||
|
|
||||||
|
# bump submodule(s) to latest tag
|
||||||
|
bump-qmk submodule="":
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
if [ -z "{{submodule}}" ]; then
|
||||||
|
targets="qmk_upstream qmk_framework"
|
||||||
|
else
|
||||||
|
targets="{{submodule}}"
|
||||||
|
fi
|
||||||
|
for sm in $targets; do
|
||||||
|
old=$(git -C $sm describe --tags --exact-match HEAD 2>/dev/null || git -C $sm rev-parse --short HEAD)
|
||||||
|
git -C $sm fetch --tags --quiet
|
||||||
|
new=$(git -C $sm tag --sort=-creatordate | head -1)
|
||||||
|
git -C $sm checkout --quiet "$new"
|
||||||
|
echo "bumped $sm from $old to $new"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user