Archived
3
0

add indentation cd checking

This commit is contained in:
2025-03-12 12:13:02 +01:00
parent 8ba3be5346
commit c342cfd877
2 changed files with 32 additions and 3 deletions

18
.github/workflows/check_indentation.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Check indentation
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check tabs
run: make test_tabs

View File

@@ -4,9 +4,9 @@ build: \
ARCH := $(shell uname -m)
MAIN_RS_SRCS := $(shell find src -type f -regex '^.*\.rs$$') Cargo.toml \
client/dst/index.html client/dst/script.js client/dst/style.css \
config.json
FILES_RS := $(shell find src -type f -regex '^.*\.rs$$')
FILES_CLIENT := client/dst/index.html client/dst/script.js client/dst/style.css
MAIN_RS_SRCS := $(FILES_RS) $(FILES_CLIENT) Cargo.toml config.json
SEARCH_REPLACE := lib/search_and_replace/target/release/search_and_replace
@@ -27,6 +27,17 @@ test: target/debug/zmp24
BIND_TO="$(DEV_BIND)" \
cargo test
.PHONY: test_tabs
test_tabs:
@for file in $(FILES_RS); do \
echo -n "$$file ... "; \
if grep -Eq '^\s* ' "$$file"; then \
echo "fail"; \
exit 1; \
fi; \
echo "ok"; \
done
.PHONY: clean
clean: client_clean
cargo clean