bashcov 3.1.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -1
- data/CHANGELOG.md +13 -4
- data/Gemfile.nix.lock +144 -0
- data/HACKING.md +166 -0
- data/INSTALL.md +115 -0
- data/LICENSE.txt +1 -1
- data/README.md +6 -2
- data/bin/bashcov +2 -0
- data/compat.nix +26 -0
- data/default.nix +1 -0
- data/flake.lock +139 -0
- data/flake.nix +225 -0
- data/gemset.nix +531 -0
- data/lib/bashcov/detective.rb +3 -3
- data/lib/bashcov/field_stream.rb +2 -2
- data/lib/bashcov/lexer.rb +7 -9
- data/lib/bashcov/line.rb +2 -2
- data/lib/bashcov/runner.rb +3 -4
- data/lib/bashcov/version.rb +1 -1
- data/lib/bashcov/xtrace.rb +9 -10
- data/lib/bashcov.rb +12 -9
- data/shell.nix +1 -0
- data/test.sh +1 -1
- metadata +26 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fa991330e449d30bbbb4ee7fa85903164e34ece8eeff6a656434a6bb87b4e04
|
4
|
+
data.tar.gz: 8acfbe356138dd648b9d85fb3d3344b8c7e55c65a6b9e8cc9a22f4ff5e15a50b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d553f6724297e945a69a75f78723b2b2733843999d4dc7e485593b4d368a77fe81e647254e6bc37e9fa4e80fe2f99270a8267b90c5b6cd98b41de60863284420
|
7
|
+
data.tar.gz: f3263ac5329d63c30c3b56deddd53f4f6c9a69d8cd9bf4dd350ae10fe8497dc88fe0670b41a9ee21d2bb73acafb0c50fd39edcdd768d3be3e601298266491430
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,30 @@
|
|
1
|
-
|
1
|
+
plugins:
|
2
2
|
- rubocop-rake
|
3
3
|
- rubocop-rspec
|
4
4
|
|
5
5
|
AllCops:
|
6
6
|
TargetRubyVersion: 3.0
|
7
7
|
NewCops: enable
|
8
|
+
# Ignore files ignored by Git. Improved version of the template shown here:
|
9
|
+
# https://docs.rubocop.org/rubocop/configuration.html#pre-processing
|
10
|
+
# Properly handles symlinks-to-directories, which `git status --ignored
|
11
|
+
# --porcelain` displays without a trailing slash.
|
12
|
+
Exclude:
|
13
|
+
<% git_ignored_file_status = `git status --ignored --porcelain 2>/dev/null` %>
|
14
|
+
<% if $? == 0 %>
|
15
|
+
<% git_ignored_file_status.each_line(chomp: true).grep(/^!! /).map { |p| p.sub(/^!! /, '') }.each do |path| %>
|
16
|
+
<% if File.directory?(path) && ! path.end_with?('/') %>
|
17
|
+
- <%= path + '/**/*' %>
|
18
|
+
<% else %>
|
19
|
+
- <%= path.sub(/\/$/, '/**/*') %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<% else %>
|
23
|
+
- 'vendor/**/*'
|
24
|
+
- 'result/**/*'
|
25
|
+
- 'result-*/**/*'
|
26
|
+
- 'repl-result-*/**/*'
|
27
|
+
<% end %>
|
8
28
|
|
9
29
|
Metrics:
|
10
30
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,18 +1,27 @@
|
|
1
|
-
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v3.
|
1
|
+
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v3.2.0...master))
|
2
2
|
|
3
3
|
* TBD
|
4
4
|
|
5
|
+
## v3.2.0, 2025-07-28 ([changes](https://github.com/infertux/bashcov/compare/v3.1.3...v3.2.0))
|
6
|
+
|
7
|
+
* [BUGFIX] Support function names containing dots (#97)
|
8
|
+
* [BUXFIX] Disable write access to repository from CI
|
9
|
+
* [BUGFIX] Don't require Runner until actually needed
|
10
|
+
* [BUGFIX] Fix Rubocop violations
|
11
|
+
* [BUGFIX] Add support for function name containing dashes
|
12
|
+
* [FEATURE] Support building Bashcov with [the Nix package manager](https://nixos.org) (#78)
|
13
|
+
|
5
14
|
## v3.1.3, 2024-08-29 ([changes](https://github.com/infertux/bashcov/compare/v3.1.2...v3.1.3))
|
6
15
|
|
7
|
-
* [BUGFIX]
|
16
|
+
* [BUGFIX] Relax simplecov version constrain for [codecov compatibility](https://github.com/infertux/bashcov/issues/88)
|
8
17
|
|
9
18
|
## v3.1.2, 2024-02-29 ([changes](https://github.com/infertux/bashcov/compare/v3.1.1...v3.1.2))
|
10
19
|
|
11
|
-
* [BUGFIX]
|
20
|
+
* [BUGFIX] Upgrade `simplecov` to [calling twice bug fix](https://github.com/simplecov-ruby/simplecov/issues/1003)
|
12
21
|
|
13
22
|
## v3.1.1, 2023-09-28 ([changes](https://github.com/infertux/bashcov/compare/v3.1.0...v3.1.1))
|
14
23
|
|
15
|
-
* [BUGFIX]
|
24
|
+
* [BUGFIX] Make sure StringIO is loaded when `--mute` is used
|
16
25
|
|
17
26
|
## v3.1.0, 2023-09-28 ([changes](https://github.com/infertux/bashcov/compare/v3.0.3...v3.1.0))
|
18
27
|
|
data/Gemfile.nix.lock
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
bashcov (3.2.0)
|
5
|
+
simplecov (~> 0.21)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
aruba (2.3.1)
|
11
|
+
bundler (>= 1.17, < 3.0)
|
12
|
+
contracts (>= 0.16.0, < 0.18.0)
|
13
|
+
cucumber (>= 8.0, < 11.0)
|
14
|
+
rspec-expectations (~> 3.4)
|
15
|
+
thor (~> 1.0)
|
16
|
+
ast (2.4.3)
|
17
|
+
base64 (0.3.0)
|
18
|
+
bigdecimal (3.2.2)
|
19
|
+
builder (3.3.0)
|
20
|
+
bundler-audit (0.9.2)
|
21
|
+
bundler (>= 1.2.0, < 3)
|
22
|
+
thor (~> 1.0)
|
23
|
+
contracts (0.17.2)
|
24
|
+
cucumber (10.0.0)
|
25
|
+
base64 (~> 0.2)
|
26
|
+
builder (~> 3.2)
|
27
|
+
cucumber-ci-environment (> 9, < 11)
|
28
|
+
cucumber-core (> 15, < 17)
|
29
|
+
cucumber-cucumber-expressions (> 17, < 19)
|
30
|
+
cucumber-html-formatter (> 20.3, < 22)
|
31
|
+
diff-lcs (~> 1.5)
|
32
|
+
logger (~> 1.6)
|
33
|
+
mini_mime (~> 1.1)
|
34
|
+
multi_test (~> 1.1)
|
35
|
+
sys-uname (~> 1.3)
|
36
|
+
cucumber-ci-environment (10.0.1)
|
37
|
+
cucumber-core (15.1.0)
|
38
|
+
cucumber-gherkin (> 27, < 31)
|
39
|
+
cucumber-messages (> 26, < 29)
|
40
|
+
cucumber-tag-expressions (> 5, < 7)
|
41
|
+
cucumber-cucumber-expressions (18.0.1)
|
42
|
+
bigdecimal
|
43
|
+
cucumber-gherkin (30.0.4)
|
44
|
+
cucumber-messages (> 25, < 28)
|
45
|
+
cucumber-html-formatter (21.13.0)
|
46
|
+
cucumber-messages (> 19, < 28)
|
47
|
+
cucumber-messages (27.2.0)
|
48
|
+
cucumber-tag-expressions (6.1.2)
|
49
|
+
diff-lcs (1.6.2)
|
50
|
+
docile (1.4.1)
|
51
|
+
ffi (1.16.3)
|
52
|
+
json (2.13.1)
|
53
|
+
language_server-protocol (3.17.0.5)
|
54
|
+
lint_roller (1.1.0)
|
55
|
+
logger (1.7.0)
|
56
|
+
mini_mime (1.1.5)
|
57
|
+
multi_test (1.1.0)
|
58
|
+
parallel (1.27.0)
|
59
|
+
parser (3.3.9.0)
|
60
|
+
ast (~> 2.4.1)
|
61
|
+
racc
|
62
|
+
prism (1.4.0)
|
63
|
+
racc (1.8.1)
|
64
|
+
rainbow (3.1.1)
|
65
|
+
rake (13.3.0)
|
66
|
+
regexp_parser (2.10.0)
|
67
|
+
rspec (3.13.1)
|
68
|
+
rspec-core (~> 3.13.0)
|
69
|
+
rspec-expectations (~> 3.13.0)
|
70
|
+
rspec-mocks (~> 3.13.0)
|
71
|
+
rspec-core (3.13.5)
|
72
|
+
rspec-support (~> 3.13.0)
|
73
|
+
rspec-expectations (3.13.5)
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
+
rspec-support (~> 3.13.0)
|
76
|
+
rspec-mocks (3.13.5)
|
77
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
78
|
+
rspec-support (~> 3.13.0)
|
79
|
+
rspec-support (3.13.4)
|
80
|
+
rubocop (1.79.0)
|
81
|
+
json (~> 2.3)
|
82
|
+
language_server-protocol (~> 3.17.0.2)
|
83
|
+
lint_roller (~> 1.1.0)
|
84
|
+
parallel (~> 1.10)
|
85
|
+
parser (>= 3.3.0.2)
|
86
|
+
rainbow (>= 2.2.2, < 4.0)
|
87
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
88
|
+
rubocop-ast (>= 1.46.0, < 2.0)
|
89
|
+
ruby-progressbar (~> 1.7)
|
90
|
+
tsort (>= 0.2.0)
|
91
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
92
|
+
rubocop-ast (1.46.0)
|
93
|
+
parser (>= 3.3.7.2)
|
94
|
+
prism (~> 1.4)
|
95
|
+
rubocop-rake (0.7.1)
|
96
|
+
lint_roller (~> 1.1)
|
97
|
+
rubocop (>= 1.72.1)
|
98
|
+
rubocop-rspec (3.6.0)
|
99
|
+
lint_roller (~> 1.1)
|
100
|
+
rubocop (~> 1.72, >= 1.72.1)
|
101
|
+
ruby-progressbar (1.13.0)
|
102
|
+
simplecov (0.22.0)
|
103
|
+
docile (~> 1.1)
|
104
|
+
simplecov-html (~> 0.11)
|
105
|
+
simplecov_json_formatter (~> 0.1)
|
106
|
+
simplecov-html (0.13.2)
|
107
|
+
simplecov_json_formatter (0.1.4)
|
108
|
+
sys-uname (1.3.1)
|
109
|
+
ffi (~> 1.1)
|
110
|
+
thor (1.4.0)
|
111
|
+
tsort (0.2.0)
|
112
|
+
unicode-display_width (3.1.4)
|
113
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
114
|
+
unicode-emoji (4.0.4)
|
115
|
+
yard (0.9.37)
|
116
|
+
|
117
|
+
PLATFORMS
|
118
|
+
aarch64-linux-gnu
|
119
|
+
aarch64-linux-musl
|
120
|
+
arm-linux-gnu
|
121
|
+
arm-linux-musl
|
122
|
+
arm64-darwin
|
123
|
+
ruby
|
124
|
+
x86-linux-gnu
|
125
|
+
x86-linux-musl
|
126
|
+
x86_64-darwin
|
127
|
+
x86_64-linux-gnu
|
128
|
+
x86_64-linux-musl
|
129
|
+
|
130
|
+
DEPENDENCIES
|
131
|
+
aruba
|
132
|
+
bashcov!
|
133
|
+
bundler-audit
|
134
|
+
cucumber
|
135
|
+
ffi (~> 1.16.0)
|
136
|
+
rake
|
137
|
+
rspec
|
138
|
+
rubocop
|
139
|
+
rubocop-rake
|
140
|
+
rubocop-rspec
|
141
|
+
yard
|
142
|
+
|
143
|
+
BUNDLED WITH
|
144
|
+
2.4.10
|
data/HACKING.md
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
# Hacking on Bashcov
|
2
|
+
|
3
|
+
[Nix development shell]: #entering-the-nix-development-shell
|
4
|
+
[`Gemfile.nix.lock`]: ./Gemfile.nix.lock
|
5
|
+
[`gemset.nix`]: ./gemset.nix
|
6
|
+
[`bashcov.gemspec`]: ./bashcov.gemspec
|
7
|
+
|
8
|
+
## Nix flake usage
|
9
|
+
|
10
|
+
This project supplies a [`flake.nix`](./flake.nix) file defining a Nix
|
11
|
+
flake[^nix-flakes] that makes it possible to build, test, run, and hack on
|
12
|
+
Bashcov using the [Nix package manager](https://nixos.org)
|
13
|
+
|
14
|
+
[^nix-flakes]: See the [NixOS wiki](https://nixos.wiki/wiki/Flakes) and the
|
15
|
+
[`nix flake` page in the Nix package manager reference manual](https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html)
|
16
|
+
for background on Nix flakes.
|
17
|
+
|
18
|
+
This Nix flake defines three important important outputs:
|
19
|
+
|
20
|
+
1. A [Nix package for Bashcov](#building-the-bashcov-package),
|
21
|
+
2. A [Nix flake check](#nix-flake-checks) (test) that runs Bashcov's
|
22
|
+
unit and feature tests,
|
23
|
+
3. A [Nix application](#running-the-nix-application),[^app] and
|
24
|
+
4. A [Nix development shell],[^devshell].
|
25
|
+
|
26
|
+
[^devshell]: Based on the [`numtide/devshell`](https://github.com/numtide/devshell) project.
|
27
|
+
[^app]: Runnable with `nix run`.
|
28
|
+
|
29
|
+
In order to work on the Bashcov project's Nix features,
|
30
|
+
you'll need to [install the Nix package manager](https://nixos.org/download.html) and
|
31
|
+
[ensure that the `flakes` and `nix-command` experimental features are enabled](https://nixos.wiki/wiki/Flakes#Enable_flakes).
|
32
|
+
|
33
|
+
### Building the Bashcov package
|
34
|
+
|
35
|
+
To build the Bashcov package exposed by this flake, run the
|
36
|
+
following command:[^verbose-output]
|
37
|
+
|
38
|
+
[^verbose-output]: Note that the `-L` flag can be omitted for terser output.
|
39
|
+
|
40
|
+
```shell-session
|
41
|
+
$ nix build -L '.#'
|
42
|
+
```
|
43
|
+
|
44
|
+
Or:
|
45
|
+
|
46
|
+
```shell-session
|
47
|
+
$ nix build -L '.#bashcov'
|
48
|
+
```
|
49
|
+
|
50
|
+
These two forms are functionally equivalent because the
|
51
|
+
Bashcov package is the default package.
|
52
|
+
|
53
|
+
In addition to building the package, `nix build` will place a symbolic link to
|
54
|
+
its output path at `./result` (`ls -lAR ./result/`, `tree ./result/`, or
|
55
|
+
similar to see what the package contains).
|
56
|
+
|
57
|
+
### Nix flake checks
|
58
|
+
|
59
|
+
This project includes a test of Bashcov's functionality and features, exposed
|
60
|
+
as a Nix flake check. In essence, this runs the Bashcov test suite, but inside
|
61
|
+
the Nix build environment[^nix-builder-execution] (which may be
|
62
|
+
sandboxed[^nix-sandbox]).
|
63
|
+
|
64
|
+
[^nix-builder-execution]: The Nix build environment is described [here](https://nixos.org/manual/nix/stable/language/derivations#builder-execution).
|
65
|
+
[^nix-sandbox]: The Nix sandbox is described [here](https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-sandbox).
|
66
|
+
|
67
|
+
This project also includes a test that Nix source files are properly
|
68
|
+
formatted.[^treefmt-nix-check]
|
69
|
+
|
70
|
+
[^treefmt-nix-check]: Defined by [`treefmt-nix`](https://github.com/numtide/treefmt-nix#flakes).
|
71
|
+
|
72
|
+
#### Running Nix flake checks
|
73
|
+
|
74
|
+
To run Nix flake checks, execute the following command:[^verbose-output]
|
75
|
+
|
76
|
+
```shell-session
|
77
|
+
$ nix flake check -L
|
78
|
+
```
|
79
|
+
|
80
|
+
If a check fails, `nix` will print a diagnostic message and exit with nonzero
|
81
|
+
status.
|
82
|
+
|
83
|
+
##### Running a check for a specific system
|
84
|
+
|
85
|
+
Running `nix flake check` will execute Nix flake checks for all supported
|
86
|
+
systems.[^supported-systems] To run a check for a particular system, instead
|
87
|
+
use the `nix build` command. For instance, to execute the Bashcov unit and
|
88
|
+
feature tests with Nix on the `x86_64-linux` system, run:[^verbose-output]
|
89
|
+
|
90
|
+
```shell-session
|
91
|
+
$ nix build -L '.#checks.x86_64-linux.bashcov'
|
92
|
+
```
|
93
|
+
|
94
|
+
[^supported-systems]: Run `nix flake show` to view flake outputs namespaced by
|
95
|
+
all supported systems.
|
96
|
+
|
97
|
+
### Running the Nix application
|
98
|
+
|
99
|
+
To run Bashcov itself:
|
100
|
+
|
101
|
+
```shell-session
|
102
|
+
$ nix run '.#' -- <args>
|
103
|
+
```
|
104
|
+
|
105
|
+
To run commands from [the Nix development shell](#entering-the-nix-development-shell)
|
106
|
+
but without entering the shell:
|
107
|
+
|
108
|
+
```shell-session
|
109
|
+
$ nix run '.#devshell' -- <command> <args>
|
110
|
+
```
|
111
|
+
|
112
|
+
For instance, to run [the `update-deps` shell command](#summary-of-available-commands):
|
113
|
+
|
114
|
+
```shell-session
|
115
|
+
$ nix run '.#devshell' -- update-deps
|
116
|
+
```
|
117
|
+
|
118
|
+
### Entering the Nix development shell
|
119
|
+
|
120
|
+
To enter the Nix development shell, run the following command:
|
121
|
+
|
122
|
+
```shell-session
|
123
|
+
$ nix develop
|
124
|
+
```
|
125
|
+
|
126
|
+
You will be presented with a menu of commands available within the development
|
127
|
+
shell.
|
128
|
+
|
129
|
+
#### Summary of available commands
|
130
|
+
|
131
|
+
- `fmt`: format all Nix code in this project using
|
132
|
+
[`alejandra`](https://github.com/kamadorueda/alejandra).
|
133
|
+
- `bundix`: tool for managing Nix <=> Ruby integration assets (Bundix lives
|
134
|
+
[here](https://github.com/nix-community/bundix)).
|
135
|
+
- `update-deps`: update [the Nix-specific lockfile][`Gemfile.nix.lock`] and
|
136
|
+
[Nix gemset][`gemset.nix`].
|
137
|
+
- `update-deps-conservative`: update [the Nix-specific lockfile][`Gemfile.nix.lock`]
|
138
|
+
and [Nix gemset][`gemset.nix`] if (and only if) `nix build` fails _without_
|
139
|
+
updates to those assets **and** `nix build` succeeds _with_ updates to them.
|
140
|
+
|
141
|
+
### Maintenance of Nix assets
|
142
|
+
|
143
|
+
The Bashcov Nix package depends on [`nixpkgs`'s Ruby
|
144
|
+
integration](https://nixos.org/manual/nixpkgs/stable/#developing-with-ruby);
|
145
|
+
specifically, it uses the `bundlerEnv` function to create an environment with
|
146
|
+
all of Bashcov's Ruby gem dependencies present. `bundlerEnv` requires a
|
147
|
+
Bundler lockfile (here, [`Gemfile.nix.lock`]) and a Nix-specific [`gemset.nix`]
|
148
|
+
that acts as a sort of translation layer between Bundler and Nix.
|
149
|
+
|
150
|
+
Both of these files must be updated from time to time in order to reflect
|
151
|
+
changes in [`bashcov.gemspec`], including certain changes to Bashcov itself
|
152
|
+
(e.g. version bumps).
|
153
|
+
|
154
|
+
> **Note**
|
155
|
+
> If [`bashcov.gemspec`] is updated without updating the Bundler lockfile and
|
156
|
+
> [`gemset.nix`], the Bashcov Nix package will fail to build.
|
157
|
+
|
158
|
+
The [Nix development shell] includes two convenience commands for managing
|
159
|
+
these assets:
|
160
|
+
|
161
|
+
- `update-deps` unconditionally updates [`Gemfile.nix.lock`] with
|
162
|
+
[`bundle lock`](https://bundler.io/v2.4/man/bundle-lock.1.html), then updates
|
163
|
+
[`gemset.nix`] to reflect any changes to the Bundler lockfile.
|
164
|
+
- `update-deps-conservative` does the same, but if (and only if) doing so fixes
|
165
|
+
failures running `nix build`. That is, it updates the assets if it looks
|
166
|
+
like problems with those assets have broken the Bashcov Nix package.
|
data/INSTALL.md
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
# Installing Bashcov
|
2
|
+
|
3
|
+
## Installation as a Ruby gem
|
4
|
+
|
5
|
+
Bashcov is distributed as [a Ruby gem](https://guides.rubygems.org/) -- that
|
6
|
+
is, as a software package for [the Ruby programming language](https://www.ruby-lang.org/en/). It is hosted on
|
7
|
+
https://rubygems.org/ and is installable with tools distributed with Ruby
|
8
|
+
itself.
|
9
|
+
|
10
|
+
### Prerequisites
|
11
|
+
|
12
|
+
- Ruby (installation instructions [here](https://www.ruby-lang.org/en/documentation/installation/)).
|
13
|
+
- Development tools (primarily, a C compiler and `make`). These are needed
|
14
|
+
because certain of Bashcov's Ruby gem dependencies include native extensions
|
15
|
+
that must be compiled for your host platform. Installation instructions are
|
16
|
+
OS- and distribution-specific; please consult your OS and/or distribution's
|
17
|
+
documentation.
|
18
|
+
|
19
|
+
### Installation with the `gem` command
|
20
|
+
|
21
|
+
The `gem` executable is included with the Ruby distribution. To install
|
22
|
+
Bashcov for your current user, run:
|
23
|
+
|
24
|
+
```shell-session
|
25
|
+
$ gem install bashcov
|
26
|
+
```
|
27
|
+
|
28
|
+
Now you can run Bashcov with:
|
29
|
+
|
30
|
+
```shell-session
|
31
|
+
$ bashcov -- <your-bash-script> <and-options>
|
32
|
+
```
|
33
|
+
|
34
|
+
### Installation with Bundler
|
35
|
+
|
36
|
+
[Bundler](https://bundler.io/), an environment manager for Ruby, is included in
|
37
|
+
(quoting the https://bundler.io/ landing page) "[a]ny modern distribution of
|
38
|
+
Ruby". To install Bashcov with Bundler, create a file named `Gemfile` in your
|
39
|
+
project's top-level directory and ensure it contains the following:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
source 'https://rubygems.org'
|
43
|
+
gem 'bashcov'
|
44
|
+
```
|
45
|
+
|
46
|
+
Then, run this to install Bashcov (and the other gems specified in your
|
47
|
+
`Gemfile`):
|
48
|
+
|
49
|
+
```shell-session
|
50
|
+
$ bundle install
|
51
|
+
```
|
52
|
+
|
53
|
+
Finally, to run Bashcov, execute:
|
54
|
+
|
55
|
+
```shell-session
|
56
|
+
$ bundle exec bashcov -- <your-bash-script> <and-options>
|
57
|
+
```
|
58
|
+
|
59
|
+
For more on Bundler, please see [its "Getting Started" guide](https://bundler.io/guides/getting_started.html#getting-started).
|
60
|
+
|
61
|
+
## Installation with the Nix package manager
|
62
|
+
|
63
|
+
Bashcov is available using [the Nix package manager](https://nixos.org/).
|
64
|
+
Specifically, Bashcov exposes a [Nix flake](https://nixos.org/) (a sort of
|
65
|
+
supercharged package) consumable via various subcommands of the `nix` command
|
66
|
+
line tool.
|
67
|
+
|
68
|
+
### Running Bashcov as [a Nix application](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-run.html)
|
69
|
+
|
70
|
+
You can use Nix to run Bashcov without first explicitly installing it:
|
71
|
+
|
72
|
+
```shell-session
|
73
|
+
$ nix run 'github:infertux/bashcov' -- <your-bash-script> <and-options>
|
74
|
+
```
|
75
|
+
|
76
|
+
### Adding Bashcov to [a Nix shell environment](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-shell)
|
77
|
+
|
78
|
+
You can start a shell with Bashcov available like so:
|
79
|
+
|
80
|
+
```shell-session
|
81
|
+
$ command -v bashcov || echo ':(' 1>&2
|
82
|
+
:(
|
83
|
+
$ nix shell 'github:infertux/bashcov'
|
84
|
+
$ command -v bashcov || echo ':(' 1>&2
|
85
|
+
/nix/store/ns3phdbmfxkf6xqbz0lzha0846ngbmwc-bashcov-3.0.2/bin/bashcov
|
86
|
+
```
|
87
|
+
|
88
|
+
### Incorporating Bashcov into your Nix flake
|
89
|
+
|
90
|
+
You can incorporate Bashcov into your own flake by declaring it as an input and
|
91
|
+
then referencing its output attribute `packages.<system>.bashcov`. For
|
92
|
+
instance, to include Bashcov in a [`nix develop` environment](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop),
|
93
|
+
you could do something like the following:
|
94
|
+
|
95
|
+
```nix
|
96
|
+
# flake.nix
|
97
|
+
|
98
|
+
{
|
99
|
+
inputs = {
|
100
|
+
bashcov.url = "github:infertux/bashcov";
|
101
|
+
bashcov.inputs.nixpkgs.follows = "nixpkgs";
|
102
|
+
};
|
103
|
+
|
104
|
+
outputs = inputs @ { nixpkgs, bashcov, ... }: let
|
105
|
+
system = "x86_64-linux";
|
106
|
+
in {
|
107
|
+
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
|
108
|
+
packages = [inputs.bashcov.packages.${system}.bashcov];
|
109
|
+
};
|
110
|
+
};
|
111
|
+
}
|
112
|
+
```
|
113
|
+
|
114
|
+
Now, when you execute `nix develop` from within your flake project, the
|
115
|
+
`bashcov` command will be available in your environment.
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
[](https://liberapay.com/infertux/donate)
|
4
4
|
[](https://rubygems.org/gems/bashcov)
|
5
|
+
[](https://github.com/infertux/bashcov/actions/workflows/ci.yml)
|
5
6
|
[](https://gitlab.com/infertux/bashcov/-/pipelines)
|
6
|
-
[](https://codeclimate.com/github/infertux/bashcov/maintainability)
|
7
7
|
[](http://inch-ci.org/github/infertux/bashcov)
|
8
8
|
|
9
9
|
Bashcov is a **code coverage analysis tool for Bash**.
|
@@ -31,6 +31,8 @@ Here are example coverages generated by Bashcov:
|
|
31
31
|
|
32
32
|
If the `gem` command is unavailable, you need to [install Ruby](https://www.ruby-lang.org/en/documentation/installation/) first.
|
33
33
|
|
34
|
+
For more information, including other installation methods, see [`INSTALL.md`](./INSTALL.md).
|
35
|
+
|
34
36
|
## Usage
|
35
37
|
|
36
38
|
`bashcov --help` prints all available options. Here are some examples:
|
@@ -55,9 +57,11 @@ See [advanced usage](./USAGE.md) for more information.
|
|
55
57
|
Bug reports and patches are most welcome.
|
56
58
|
See the [contribution guidelines](https://github.com/infertux/bashcov/blob/master/CONTRIBUTING.md).
|
57
59
|
|
60
|
+
For development tips, see [the hacking guide](./HACKING.md).
|
61
|
+
|
58
62
|
## Sponsorship
|
59
63
|
|
60
|
-
Bashcov was [created in 2012](https://github.com/infertux/bashcov/commit/f65e65e5aa3377beb334beee9924136a34a913e8) and it needs your help. I have been maintaining the project for over a decade and keeping it working with new releases of Bash and Ruby takes time. If you use Bashcov professionally, please
|
64
|
+
Bashcov was [created in 2012](https://github.com/infertux/bashcov/commit/f65e65e5aa3377beb334beee9924136a34a913e8) and it needs your help. I have been maintaining the project for over a decade and keeping it working with new releases of Bash and Ruby takes time. If you use Bashcov professionally, please consider supporting it on [Liberapay](https://liberapay.com/infertux) through your employer or directly. Thank you for supporting *Free and Open-Source Software*.
|
61
65
|
|
62
66
|
## License
|
63
67
|
|
data/bin/bashcov
CHANGED
data/compat.nix
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
let
|
2
|
+
haveFlakeLock = builtins.pathExists ./flake.lock;
|
3
|
+
|
4
|
+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
5
|
+
|
6
|
+
ref =
|
7
|
+
if haveFlakeLock
|
8
|
+
then lock.nodes.flake-compat.locked.rev
|
9
|
+
else "master";
|
10
|
+
|
11
|
+
checksum =
|
12
|
+
if haveFlakeLock
|
13
|
+
then {
|
14
|
+
sha256 = lock.nodes.flake-compat.locked.narHash;
|
15
|
+
}
|
16
|
+
else {};
|
17
|
+
|
18
|
+
args =
|
19
|
+
{
|
20
|
+
url = "https://github.com/edolstra/flake-compat/archive/${ref}.tar.gz";
|
21
|
+
}
|
22
|
+
// checksum;
|
23
|
+
|
24
|
+
flakeCompat = fetchTarball args;
|
25
|
+
in
|
26
|
+
import flakeCompat {src = ./.;}
|
data/default.nix
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(import ./compat.nix).defaultNix
|