add indentation cd checking
This commit is contained in:
18
.github/workflows/check_indentation.yml
vendored
Normal file
18
.github/workflows/check_indentation.yml
vendored
Normal 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
|
17
Makefile
17
Makefile
@@ -4,9 +4,9 @@ build: \
|
|||||||
|
|
||||||
ARCH := $(shell uname -m)
|
ARCH := $(shell uname -m)
|
||||||
|
|
||||||
MAIN_RS_SRCS := $(shell find src -type f -regex '^.*\.rs$$') Cargo.toml \
|
FILES_RS := $(shell find src -type f -regex '^.*\.rs$$')
|
||||||
client/dst/index.html client/dst/script.js client/dst/style.css \
|
FILES_CLIENT := client/dst/index.html client/dst/script.js client/dst/style.css
|
||||||
config.json
|
MAIN_RS_SRCS := $(FILES_RS) $(FILES_CLIENT) Cargo.toml config.json
|
||||||
|
|
||||||
SEARCH_REPLACE := lib/search_and_replace/target/release/search_and_replace
|
SEARCH_REPLACE := lib/search_and_replace/target/release/search_and_replace
|
||||||
|
|
||||||
@@ -27,6 +27,17 @@ test: target/debug/zmp24
|
|||||||
BIND_TO="$(DEV_BIND)" \
|
BIND_TO="$(DEV_BIND)" \
|
||||||
cargo test
|
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
|
.PHONY: clean
|
||||||
clean: client_clean
|
clean: client_clean
|
||||||
cargo clean
|
cargo clean
|
||||||
|
Reference in New Issue
Block a user