Skip to content

Commit 8b1ab0a

Browse files
committed
Sync with latest boilerplate.
* CI: Update GitHub Actions versions. * QA: Add shellcheck and fix/ignore all issues. * install.sh: slightly better feedback for setup commands.
1 parent e6cd19c commit 8b1ab0a

File tree

7 files changed

+87
-88
lines changed

7 files changed

+87
-88
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Code
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Set up Python ${{ matrix.python }}
25-
uses: actions/setup-python@v3
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python }}
2828

@@ -35,7 +35,7 @@ jobs:
3535
make build
3636
3737
- name: Upload Packages
38-
uses: actions/upload-artifact@v3
38+
uses: actions/upload-artifact@v4
3939
with:
4040
name: ${{ env.RELEASE_FILE }}
4141
path: dist/

.github/workflows/qa.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ jobs:
1010
test:
1111
name: linting & spelling
1212
runs-on: ubuntu-latest
13-
1413
env:
1514
TERM: xterm-256color
1615

1716
steps:
1817
- name: Checkout Code
19-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
2019

2120
- name: Set up Python '3,11'
22-
uses: actions/setup-python@v3
21+
uses: actions/setup-python@v5
2322
with:
2423
python-version: '3.11'
2524

@@ -34,3 +33,7 @@ jobs:
3433
- name: Run Code Checks
3534
run: |
3635
make check
36+
37+
- name: Run Bash Code Checks
38+
run: |
39+
make shellcheck

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v3
2020

2121
- name: Set up Python ${{ matrix.python }}
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python }}
2525

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ uninstall:
3030

3131
dev-deps:
3232
python3 -m pip install -r requirements-dev.txt
33-
sudo apt install dos2unix
33+
sudo apt install dos2unix shellcheck
3434

3535
check:
3636
@bash check.sh
3737

38+
shellcheck:
39+
shellcheck *.sh
40+
3841
qa:
3942
tox -e qa
4043

check.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# This script handles some basic QA checks on the source
44

55
NOPOST=$1
6-
LIBRARY_NAME=`hatch project metadata name`
7-
LIBRARY_VERSION=`hatch version | awk -F "." '{print $1"."$2"."$3}'`
8-
POST_VERSION=`hatch version | awk -F "." '{print substr($4,0,length($4))}'`
6+
LIBRARY_NAME=$(hatch project metadata name)
7+
LIBRARY_VERSION=$(hatch version | awk -F "." '{print $1"."$2"."$3}')
8+
POST_VERSION=$(hatch version | awk -F "." '{print substr($4,0,length($4))}')
99
TERM=${TERM:="xterm-256color"}
1010

1111
success() {
@@ -29,7 +29,7 @@ while [[ $# -gt 0 ]]; do
2929
;;
3030
*)
3131
if [[ $1 == -* ]]; then
32-
printf "Unrecognised option: $1\n";
32+
printf "Unrecognised option: %s\n" "$1";
3333
exit 1
3434
fi
3535
POSITIONAL_ARGS+=("$1")
@@ -40,8 +40,7 @@ done
4040
inform "Checking $LIBRARY_NAME $LIBRARY_VERSION\n"
4141

4242
inform "Checking for trailing whitespace..."
43-
grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
44-
if [[ $? -eq 0 ]]; then
43+
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO; then
4544
warning "Trailing whitespace found!"
4645
exit 1
4746
else
@@ -50,8 +49,7 @@ fi
5049
printf "\n"
5150

5251
inform "Checking for DOS line-endings..."
53-
grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
54-
if [[ $? -eq 0 ]]; then
52+
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
5553
warning "DOS line-endings found!"
5654
exit 1
5755
else
@@ -60,8 +58,7 @@ fi
6058
printf "\n"
6159

6260
inform "Checking CHANGELOG.md..."
63-
cat CHANGELOG.md | grep ^${LIBRARY_VERSION} > /dev/null 2>&1
64-
if [[ $? -eq 1 ]]; then
61+
if ! grep "^${LIBRARY_VERSION}" CHANGELOG.md > /dev/null 2>&1; then
6562
warning "Changes missing for version ${LIBRARY_VERSION}! Please update CHANGELOG.md."
6663
exit 1
6764
else
@@ -70,8 +67,7 @@ fi
7067
printf "\n"
7168

7269
inform "Checking for git tag ${LIBRARY_VERSION}..."
73-
git tag -l | grep -E "${LIBRARY_VERSION}$"
74-
if [[ $? -eq 1 ]]; then
70+
if ! git tag -l | grep -E "${LIBRARY_VERSION}$"; then
7571
warning "Missing git tag for version ${LIBRARY_VERSION}"
7672
fi
7773
printf "\n"

0 commit comments

Comments
 (0)