diff options
| author | Alexander Regueiro <alexreg@me.com> | 2018-02-23 21:51:29 +0000 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2018-03-26 20:28:00 -0500 |
| commit | 5f4e24d4ec123c5ea79f4e3c8f7b56c77ee29788 (patch) | |
| tree | b6d19af7ad881e25151fba68ea73f9986e208d78 /src/doc/rustc-dev-guide/ci | |
| parent | 85a834b74b30aac00ed81cf2971c554621d7275a (diff) | |
| download | rust-5f4e24d4ec123c5ea79f4e3c8f7b56c77ee29788.tar.gz rust-5f4e24d4ec123c5ea79f4e3c8f7b56c77ee29788.zip | |
Added check for all source files to ensure they have no lines longer than 80 chars.
Diffstat (limited to 'src/doc/rustc-dev-guide/ci')
| -rwxr-xr-x | src/doc/rustc-dev-guide/ci/check_line_lengths.sh | 19 | ||||
| -rwxr-xr-x[-rw-r--r--] | src/doc/rustc-dev-guide/ci/install.sh | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/ci/check_line_lengths.sh b/src/doc/rustc-dev-guide/ci/check_line_lengths.sh new file mode 100755 index 00000000000..8001ea9a7c3 --- /dev/null +++ b/src/doc/rustc-dev-guide/ci/check_line_lengths.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." diff --git a/src/doc/rustc-dev-guide/ci/install.sh b/src/doc/rustc-dev-guide/ci/install.sh index 975857a95a0..ea90e853dfa 100644..100755 --- a/src/doc/rustc-dev-guide/ci/install.sh +++ b/src/doc/rustc-dev-guide/ci/install.sh @@ -1,4 +1,5 @@ #!/bin/bash + set -ex function cargo_install() { |
