Add precommit

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2021-01-15 14:50:15 +01:00
parent c3f0e6bb39
commit bf1c5cdc30
2 changed files with 14 additions and 2 deletions

10
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

View file

@ -1,9 +1,9 @@
CC = clang CC = clang
TIDY = clang-tidy TIDY = clang-tidy
CFLAGS = -std=c11 -Wall -Wextra CFLAGS = -std=c11 -Wall -Wextra
LDLIBS = -lm LDLIBS = -lm
build: all:
$(CC) $(CFLAGS) main.c $(LDLIBS) -o main $(CC) $(CFLAGS) main.c $(LDLIBS) -o main
tidy: tidy:
@ -14,3 +14,5 @@ format:
clean: clean:
rm -f main *.o rm -f main *.o
.PHONY: tidy format clean