File tree Expand file tree Collapse file tree 10 files changed +185
-0
lines changed Expand file tree Collapse file tree 10 files changed +185
-0
lines changed Original file line number Diff line number Diff line change
1
+ language : rust
2
+ rust : nightly
3
+ cache : cargo
4
+ sudo : false
5
+ git :
6
+ depth : 1
7
+ script : ci/run.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FOLDER=" ."
4
+ FILES=' .+\.\(md\|rs\|\sh\|toml\|txt\|yml\)'
5
+
6
+ # Exit script on first error
7
+ set -o errexit -o nounset
8
+
9
+ # Explain what we do
10
+ echo -n " >>> Seaching for lines with trailing whitespaces..."
11
+
12
+ # Check any text file
13
+ FOUND=0
14
+ for FILE in $( find $FOLDER -regex $FILES ) ; do
15
+ # Ignore files that are ignored by git
16
+ git check-ignore -q $FILE && continue
17
+
18
+ # Search for trailing whitespaces
19
+ if egrep -q " +$" $FILE ; then
20
+ [ $FOUND == 0 ] && echo -e " \tError."
21
+ echo -e " Found:\t$FILE "
22
+ FOUND=1
23
+ fi
24
+ done
25
+ test $FOUND == 0
26
+ echo -e " \tDone."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FOLDER=" ."
4
+ FILES=' .+\.\(md\|rs\|\sh\|toml\|txt\|yml\)'
5
+
6
+ # Exit script on first error
7
+ set -o errexit -o nounset
8
+
9
+ # Explain what we do
10
+ echo -n " >>> Seaching for files without a trailing newline..."
11
+
12
+ # Check any text file
13
+ FOUND=0
14
+ for FILE in $( find $FOLDER -regex $FILES ) ; do
15
+ # Ignore files that are ignored by git
16
+ git check-ignore -q $FILE && continue
17
+
18
+ # Search for trailing newline
19
+ LASTLINE=$( tail -n 1 $FILE ; echo x)
20
+ LASTLINE=${LASTLINE% x}
21
+ if [ " ${LASTLINE: -1} " != $' \n ' ]; then
22
+ [ $FOUND == 0 ] && echo -e " \tError."
23
+ echo -e " Found:\t$FILE "
24
+ FOUND=1
25
+ fi
26
+ done
27
+ test $FOUND == 0
28
+ echo -e " \tDone."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FOLDER=" ."
4
+ FILES=' .+\.\(md\|rs\|\sh\|toml\|txt\|yml\)'
5
+
6
+ # Exit script on first error
7
+ set -o errexit -o nounset
8
+
9
+ # Explain what we do
10
+ echo -n " >>> Seaching for files with wrong line endings..."
11
+
12
+ # Check any text file
13
+ FOUND=0
14
+ for FILE in $( find $FOLDER -regex $FILES ) ; do
15
+ # Ignore files that are ignored by git
16
+ git check-ignore -q $FILE && continue
17
+
18
+ # Search wrong line endings
19
+ if grep -q $' \r ' $FILE ; then
20
+ [ $FOUND == 0 ] && echo -e " \tError."
21
+ echo -e " Found: $FILE "
22
+ FOUND=1
23
+ fi
24
+ done
25
+ test $FOUND == 0
26
+ echo -e " \tDone."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FOLDER=" ."
4
+ FILES=' .+\.\(md\|rs\|\sh\|toml\|txt\|yml\)'
5
+
6
+ # Exit script on first error
7
+ set -o errexit -o nounset
8
+
9
+ # Explain what we do
10
+ echo -n " >>> Seaching for files with tab characters..."
11
+
12
+ # Check any text file
13
+ FOUND=0
14
+ for FILE in $( find $FOLDER -regex $FILES ) ; do
15
+ # Ignore files that are ignored by git
16
+ git check-ignore -q $FILE && continue
17
+
18
+ # Search for files with tab characters
19
+ if grep -q $' \t ' $FILE ; then
20
+ [ $FOUND == 0 ] && echo -e " \t\tError."
21
+ echo -e " Found: $FILE "
22
+ FOUND=1
23
+ fi
24
+ done
25
+ test $FOUND == 0
26
+ echo -e " \t\tDone."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ FOLDER=" ."
4
+ FILES=' .+\.\(md\|rs\|\sh\|toml\|txt\|yml\)'
5
+ COLS=100
6
+
7
+ # Exit script on first error
8
+ set -o errexit -o nounset
9
+
10
+ # Explain what we do
11
+ echo -n " >>> Seaching for lines exceeding the length limit..."
12
+
13
+ # Check any text file
14
+ FOUND=0
15
+ for FILE in $( find $FOLDER -regex $FILES ) ; do
16
+ # Ignore files that are ignored by git
17
+ git check-ignore -q $FILE && continue
18
+
19
+ # Seach for lines that are too long
20
+ if [ $( wc -L $FILE | cut -d" " -f1) -gt $COLS ]; then
21
+ [ $FOUND == 0 ] && echo -e " \tError."
22
+ echo -e " Found: $FILE "
23
+ FOUND=1
24
+ fi
25
+ done
26
+ test $FOUND == 0
27
+ echo -e " \tDone."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Exit script on first error
4
+ set -o errexit -o nounset
5
+
6
+ # Explain what we do
7
+ echo " >>> Building..."
8
+
9
+ # Build the project
10
+ export RUSTFLAGS=" --deny warnings"
11
+ cargo build
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Exit script on first error
4
+ set -o errexit -o nounset
5
+
6
+ # Explain what we do
7
+ echo " >>> Running the tests..."
8
+
9
+ # Build the project
10
+ export RUSTFLAGS=" --deny warnings"
11
+ cargo test
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Exit script on first error
4
+ set -o errexit -o nounset
5
+
6
+ # Explain what we do
7
+ echo " >>> Checking the documentation..."
8
+
9
+ # Build the project
10
+ export RUSTFLAGS=" --deny warnings"
11
+ cargo doc
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Exit script on first error
4
+ set -o errexit -o nounset
5
+
6
+ # Compute the current directory
7
+ DIR=" ` dirname \" $0 \" ` "
8
+
9
+ # Run each test
10
+ for TEST in $( find $DIR /* -* -type f) ; do
11
+ $TEST
12
+ done
You can’t perform that action at this time.
0 commit comments