Skip to content

Commit 121ba89

Browse files
authored
Fix linting with new tool versions (#654)
## Changes * Removes unnecessary `\` at the ends of lines in `lint.sh`. * Removes unnecessary self-assignment in `checkLineWidth.sh`. ## Examples * `./lint.sh` no longer generates errors: ```console $ ./lint.sh $ ```
1 parent ae3d8ce commit 121ba89

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.circleci/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
5555
cpp-test:
5656
docker:
57-
- image: alpine:3.12.1
57+
- image: alpine:3.13.5
5858
auth:
5959
username: maxitg
6060
password: $DOCKERHUB_PASSWORD
@@ -65,7 +65,8 @@ jobs:
6565
- run:
6666
name: Install Required Tools
6767
command: |
68-
apk add --no-cache bash git g++ make cmake clang py-pip shellcheck shfmt grep npm
68+
apk add --no-cache bash git g++ make cmake clang py-pip shellcheck grep npm
69+
apk add --no-cache shfmt --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
6970
pip install cpplint
7071
npm install -g markdownlint-cli
7172
@@ -98,7 +99,7 @@ jobs:
9899

99100
cpp-32-test:
100101
docker:
101-
- image: i386/alpine:3.12.1
102+
- image: i386/alpine:3.13.5
102103
auth:
103104
username: maxitg
104105
password: $DOCKERHUB_PASSWORD

lint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ fi
5151
exitStatus=0
5252

5353
for file in "${filesToLint[@]}"; do
54-
if [[ "$file" == *.png || \
55-
"$file" == Dependencies/* || \
56-
"$file" == libSetReplace/WolframHeaders/* || \
54+
if [[ "$file" == *.png ||
55+
"$file" == Dependencies/* ||
56+
"$file" == libSetReplace/WolframHeaders/* ||
5757
"$file" == *.xcodeproj/* ]]; then
5858
:
5959
elif [[ "$file" == *.cpp || "$file" == *.hpp || "$file" == *.h ]]; then

scripts/checkLineWidth.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ widthLimit="$2"
1212
grepOutput=$(grep --line-number --color=never --extended-regexp ".{$((widthLimit + 1))}" "$filename" || :)
1313

1414
if [ -n "$grepOutput" ]; then
15-
filename="$filename"
1615
echo "$grepOutput" | awk -v filename="$filename" '{print filename ":" $0}'
1716
exit 1
1817
fi

0 commit comments

Comments
 (0)