Added check for all source files to ensure they have no lines longer than 80 chars.
This commit is contained in:
parent
fee021d143
commit
95092971ab
|
|
@ -1,6 +1,8 @@
|
|||
language: rust
|
||||
cache:
|
||||
- cargo
|
||||
before_install:
|
||||
- MAX_LINE_LENGTH=80 bash ci/check_line_lengths.sh src/**/*.md
|
||||
install:
|
||||
- source ~/.cargo/env || true
|
||||
- bash ci/install.sh
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Checking line lengths in all source files <= $MAX_LINE_LENGTH chars..."
|
||||
|
||||
echo "Offending files and lines:"
|
||||
(( success = 1 ))
|
||||
for file in "$@" ; do
|
||||
echo "$file"
|
||||
(( line_no = 0 ))
|
||||
while IFS="" read -r line || [[ -n "$line" ]] ; do
|
||||
(( line_no++ ))
|
||||
if (( "${#line}" > $MAX_LINE_LENGTH )) ; then
|
||||
(( success = 0 ))
|
||||
echo -e "\t$line_no : $line"
|
||||
fi
|
||||
done < "$file"
|
||||
done
|
||||
|
||||
(( $success )) && echo "No offending lines found."
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
function cargo_install() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue