Skip to content

Commit 1d611b0

Browse files
authored
Merge pull request #536 from DannyBen/refactor/example-tester
Refactor static analysis checks
2 parents 908edc6 + 1242144 commit 1d611b0

File tree

23 files changed

+287
-547
lines changed

23 files changed

+287
-547
lines changed

.github/workflows/static-analysis.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,14 @@ jobs:
3030
- name: Setup Ruby
3131
uses: ruby/setup-ruby@v1
3232
with:
33-
ruby-version: '3.1'
33+
ruby-version: '3.2'
3434
bundler-cache: true
3535

36-
- name: Generate all examples
36+
- name: Generate all examples and fixtures
3737
run: bundle exec run examples regen
3838

39-
- name: Generate all fixtures
40-
run: bundle exec run fixtures regen
41-
42-
- name: Run shellcheck tests (examples)
43-
run: bundle exec run shellcheck examples
44-
45-
- name: Run shellcheck tests (fixtures)
46-
run: bundle exec run shellcheck fixtures
47-
48-
- name: Run shfmt tests (examples)
49-
run: bundle exec run shfmt examples
50-
51-
- name: Run shfmt tests (fixtures)
52-
run: bundle exec run shfmt fixtures
39+
- name: Run shellcheck and shfmt tests
40+
run: bundle exec run static
5341

5442
json_schema:
5543
name: Validate JSON schemas
@@ -77,7 +65,7 @@ jobs:
7765
- name: Setup Ruby
7866
uses: ruby/setup-ruby@v1
7967
with:
80-
ruby-version: '3.1'
68+
ruby-version: '3.2'
8169
bundler-cache: true
8270

8371
- name: Generate all subjects

examples/render-mandoc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
download
2+
src/*.sh
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
download
2+
src/*.sh

runfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require 'debug'
22
require 'bashly/version'
33
require_relative 'support/runfile/example'
4-
require_relative 'support/runfile/workspace_fixture'
54

65
title 'Bashly Developer Toolbelt'
76
summary 'Runfile tasks for building the Bashly gem'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
completions.yml
2+
private
3+
src/*.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cli

spec/fixtures/workspaces/lib-custom-source/cli

Lines changed: 0 additions & 184 deletions
This file was deleted.

spec/fixtures/workspaces/lib-upgrade/src/lib/colors.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
# ---
2-
# Color functions [@bashly-upgrade colors]
3-
# This file is a part of Bashly standard library
4-
#
5-
# Usage:
6-
# Use any of the functions below to color or format a portion of a string.
7-
#
8-
# echo "before $(red this is red) after"
9-
# echo "before $(green_bold this is green_bold) after"
10-
#
11-
# Color output will be disabled if `NO_COLOR` environment variable is set
12-
# in compliance with https://no-color.org/
13-
#
14-
# ---
15-
1+
## Color functions [@bashly-upgrade colors]
2+
## This file is a part of Bashly standard library
3+
##
4+
## Usage:
5+
## Use any of the functions below to color or format a portion of a string.
6+
##
7+
## echo "before $(red this is red) after"
8+
## echo "before $(green_bold this is green_bold) after"
9+
##
10+
## Color output will be disabled if `NO_COLOR` environment variable is set
11+
## in compliance with https://no-color.org/
12+
##
1613
print_in_color() {
1714
local color="$1"
1815
shift
1916
if [[ -z ${NO_COLOR+x} ]]; then
20-
printf "$color%b\e[0m\n" "$*";
17+
printf "$color%b\e[0m\n" "$*"
2118
else
22-
printf "%b\n" "$*";
19+
printf "%b\n" "$*"
2320
fi
2421
}
2522

0 commit comments

Comments
 (0)