Add lint to ensure spaces are used for indentation

This commit is contained in:
Tim Crawford 2021-03-09 15:29:40 -07:00 committed by Jeremy Soller
parent 4963e04a83
commit 8bdcf243ec
3 changed files with 10 additions and 2 deletions

View File

@ -5,12 +5,14 @@ on:
pull_request:
jobs:
spdx:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Check SPDX identifiers
run: ./scripts/spdx.sh
run: ./scripts/lint/spdx.sh
- name: Check indentation
run: ./scripts/lint/indent.sh
tool:
strategy:

6
scripts/lint/indent.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
# Check files do not use tabs for indentation
git ls-files '*.[c\|h\|rs\|sh]' | xargs grep --line-number $'^\s*\t' && exit 1
exit 0