mirror of
https://github.com/touchHLE/touchHLE.git
synced 2026-01-31 01:25:24 +01:00
Add comment line length check to linting script
Change-Id: I8543abb74440c92df5fe5b8b29baff178adda123
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo 'Checking for long comment lines…'
|
||||
# Single-line comments are easy to find and they are the norm in this project,
|
||||
# so only those are checked for.
|
||||
# Comments not preceded by whitespace are ignored since the line length limit
|
||||
# for source is longer than 80 currently.
|
||||
# Comments containing URLs are ignored because wrapping those is unreasonable.
|
||||
(grep -n '^ *\/\/' \
|
||||
-r --include '*.rs' --include '*.cpp' --include '*.hpp' --include '*.c' \
|
||||
--include '*.h' --include '*.m' \
|
||||
build.rs src tests/*.rs tests/TestApp_source \
|
||||
| grep '[^:]\+:[^:]\+:.\{81,\}' \
|
||||
| grep -v 'https:\|http:') \
|
||||
&& printf '\e[31m''Overly long comment lines found. Please wrap comment lines to 80 characters.''\e[0m\n' && exit 1
|
||||
printf '\e[32mNone found.\e[0m\n'
|
||||
|
||||
set -ex
|
||||
|
||||
cargo clippy
|
||||
cargo doc
|
||||
|
||||
Reference in New Issue
Block a user