Skip to content

Commit f0e0481

Browse files
committed
lint: Make ShellCheck happy
1 parent abb86ba commit f0e0481

File tree

3 files changed

+22
-76
lines changed

3 files changed

+22
-76
lines changed

.github/workflows/test.yaml

Lines changed: 10 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,16 @@
1-
name: 'ci'
1+
name: 'Test'
22

33
on:
44
push:
5-
branches: [main, dev, ci/*]
6-
pull_request:
7-
branches: [main, dev, ci/*]
5+
branches-ignore: ['*-no-ci']
6+
tags-ignore: ['*']
87

9-
permissions: read-all
8+
permissions:
9+
contents: 'read'
10+
pages: 'write'
11+
id-token: 'write'
1012

1113
jobs:
12-
test-linux:
13-
name: 'Linux Test'
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
os: ['ubuntu-20.04'] # ubuntu-18.04, ubuntu-20.04, ubuntu-latest
18-
# bash-version: ['4.3', '4.4', '5.0', 'latest']
19-
20-
runs-on: '${{ matrix.os }}'
21-
22-
steps:
23-
- name: Checkout repository
24-
uses: 'actions/checkout@v2'
25-
26-
- name: Build image
27-
run: |
28-
docker build \
29-
--tag bash-object:bash-version \
30-
.
31-
32-
- name: Run tests
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
run: |
36-
time docker run --env GITHUB_TOKEN bash-object:bash-version \
37-
--tap tests
38-
39-
# FIXME
40-
# test-mac:
41-
# name: 'MacOS Test'
42-
# strategy:
43-
# fail-fast: false
44-
# matrix:
45-
# os: ['macos-10.15'] # macos-10.15, macos-11, macos-latest
46-
47-
# runs-on: '${{ matrix.os }}'
48-
49-
# steps:
50-
# - uses: 'actions/checkout@v2'
51-
# with:
52-
# submodules: true
53-
# path: 'source'
54-
55-
# - name: Install Prerequisites
56-
# run: |
57-
# # gnu-tar is only for the 'Install Bats' step
58-
# brew install bash coreutils curl gnu-tar
59-
60-
# - name: Install Bats
61-
# run: |
62-
# subdir='.workflow-data'
63-
# bats_version='1.4.1'
64-
65-
# cd source
66-
67-
# curl -LsSo "$subdir/bats-core.tar.gz" --create-dirs \
68-
# https://github.com/bats-core/bats-core/archive/v$bats_version.tar.gz
69-
# gtar --extract --transform "s,bats-core-$bats_version,bats-core," -C "$subdir" -f "$subdir/bats-core.tar.gz"
70-
71-
# - name: Run tests
72-
# run: |
73-
# subdir='.workflow-data'
74-
75-
# cd source
76-
77-
# bash --version
78-
# git config --global user.email "[email protected]"
79-
# git config --global user.name "User Name"
80-
# printf "%s\n" "---"
81-
82-
# time "./$subdir/bats-core/bin/bats" --tap tests
14+
bash:
15+
name: 'Bash'
16+
uses: 'fox-land/hyperupcall-action/.github/workflows/bash-test.yml@main'

.shellcheckrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
disable=SC1090
22
disable=SC1091
3+
disable=SC2034
4+
disable=SC2031
5+
disable=SC2030
6+
disable=SC2178
7+
disable=SC2154
8+
disable=SC2153
9+
disable=SC2154
10+
disable=SC2164
11+
disable=SC2154
12+
disable=SC1007

tests/get-value.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ load './util/init.sh'
3939
bobject set-string --ref 'OBJECT' '.obj' str
4040

4141
bobject get-string --value 'OBJECT' '.obj'
42+
# shellcheck disable=SC2128
4243
assert [ "$REPLY" = woof ]
4344

4445
REPLY='meow'
4546

4647
bobject get-string --value 'OBJECT' '.obj'
48+
# shellcheck disable=SC2128
4749
assert [ "$REPLY" = woof ]
4850
}

0 commit comments

Comments
 (0)