Skip to content

Commit 547787b

Browse files
committed
Refactor
1 parent d7423f5 commit 547787b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function path::realize() {
3434
SHELL_SOURCE="$(path::absolutisation "$(path::realize "${BASH_SOURCE[0]}")")"
3535
declare -r SHELL_SOURCE
3636
PATH="$(dirname "$SHELL_SOURCE"):$PATH"
37+
3738
# shellcheck source=./src/functions.sh
3839
source "functions.sh"
3940
# shellcheck source=./src/github.sh
@@ -51,18 +52,6 @@ source "reporter.sh"
5152
# shellcheck source=./src/reporter.sh
5253
source "rules.sh"
5354

54-
{
55-
sources_file="$(mktemp)"
56-
{
57-
reporter::sources
58-
} | while read -r file
59-
do
60-
echo source "$file"
61-
done > "$sources_file"
62-
# shellcheck source=/dev/null
63-
source "$sources_file"
64-
}
65-
6655
function usage() {
6756
{
6857
echo "Usage: $(basename "$0") [-d] [-x] [-h] [-p parallelism] [-c run-control] [-f filter] [-r reporter] [-e extension[,extension]...] slug"
@@ -85,6 +74,7 @@ function main() {
8574
local parallelism="${GITHUBLINT_PARALLELISM:-100}"
8675

8776
rules::declare
77+
reporter::declare
8878

8979
trap finally EXIT
9080

src/reporter.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ function reporter::list() {
88
function reporter::sources() {
99
find "${BASH_SOURCE[0]%.*}" -name '*.sh'
1010
}
11+
12+
function reporter::declare() {
13+
sources_file="$(mktemp)"
14+
reporter::sources | while read -r file
15+
do
16+
echo source "$file"
17+
done > "$sources_file"
18+
# shellcheck source=/dev/null
19+
source "$sources_file"
20+
}

0 commit comments

Comments
 (0)