Icarus-Mod-Tools 3.2.1 → 3.2.2
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/icarus/mod/cli/subcommand_base.rb +4 -8
- data/lib/icarus/mod/cli/validate.rb +29 -22
- data/lib/icarus/mod/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d922315481e0b1bd34f88773cf5ea5e49ec1117ad58ec9239643379581796752
|
|
4
|
+
data.tar.gz: 496323127ce64f211a3ccfdf38e33c8a77ff07700ad7138c87507ccf79bd03d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af8b4aec44f89f55c51033503287024047a15c1b9d486cf624fc9c7903e31c5a2c7cfedbd738cf64e2801456269b645d1d10bff248fdda560f6c3e00e11cb093
|
|
7
|
+
data.tar.gz: 61f3bad314fef578815e1a4e29653c36e956f812f839ba30c5ff85f1a5009bd3e035c3e65bb031147109df0bdd784ffd6baedc806896ea57b43e403de6542749
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## History (reverse chronological order)
|
|
6
6
|
|
|
7
|
+
### v3.2.2 - 2026-10-31
|
|
8
|
+
|
|
9
|
+
- `imt validate modinfo`/`toolinfo` now hides "Invalid URL" and GitHub URL auto-fix warnings unless `-v` is given, and ends with a count of what it hid (`N URL/auto-fix warnings hidden; run with -v to see them`); other warnings and all errors still show
|
|
10
|
+
- Fix `--no-verbose` crashing every subcommand with `FrozenError` (it tried to rewrite Thor's frozen options)
|
|
11
|
+
|
|
7
12
|
### v3.2.1 - 2026-10-31
|
|
8
13
|
|
|
9
14
|
- Fix `imt add repos owner/repo` storing a bare `owner/repo`, which stage 1 of sync never searched (it only looked at entries containing "github"); it now stores the canonical `https://github.com/owner/repo` for any GitHub form, refuses non-GitHub repositories, and does nothing when the repository is already listed under any spelling
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -170,6 +170,8 @@ Commands:
|
|
|
170
170
|
imt validate toolinfo # Reads Toolinfo data from 'meta/toolinfo/list' and Validates syntax of toolfiles
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
`imt validate modinfo` and `imt validate toolinfo` print every error and warning, except "Invalid URL" and GitHub URL auto-fix warnings, which only appear with `-v`; without it, the run ends with a count of how many were hidden.
|
|
174
|
+
|
|
173
175
|
`imt validate repo OWNER/REPO [--json]` (a `github.com` URL also works) vets a repo someone asked to have added, before you add it. It is read-only, never touches Firestore, and needs only the GitHub token from the config. It checks that the repo exists, is public and is not archived; finds `modinfo.json` and/or `toolinfo.json` (at least one is required); validates every entry; and requests every file, image and readme link (following up to 5 redirects) to confirm it resolves. A broken download link is an error, a broken image or readme link is a warning, and a download hosted outside GitHub or a tool shipping an `.exe` is a warning. Use `-v`/`-vv` for more detail, or `--json` to print the machine-readable result (`repo`, `exists`, `private`, `archived`, `default_branch`, `info_files`, `problems`, `entries`, `valid`) and nothing else on stdout.
|
|
174
176
|
|
|
175
177
|
**Exit status**: 0 when the repo is valid, 1 when it is not, 2 on usage, config or GitHub API errors (for example a rate limit or bad token).
|
|
@@ -12,18 +12,14 @@ module Icarus
|
|
|
12
12
|
desc: "Increase verbosity. May be repeated for even more verbosity."
|
|
13
13
|
|
|
14
14
|
no_commands do
|
|
15
|
-
|
|
16
|
-
options[:verbose] = [] if options[:verbose].include?(false)
|
|
17
|
-
end
|
|
18
|
-
|
|
15
|
+
# --no-verbose appends false; Thor freezes options, so derive the level instead of rewriting it
|
|
19
16
|
def verbose
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
flags = options[:verbose] || []
|
|
18
|
+
flags.include?(false) ? 0 : flags.count
|
|
22
19
|
end
|
|
23
20
|
|
|
24
21
|
def verbose?
|
|
25
|
-
|
|
26
|
-
options[:verbose]&.count&.positive?
|
|
22
|
+
verbose.positive?
|
|
27
23
|
end
|
|
28
24
|
end
|
|
29
25
|
|
|
@@ -9,6 +9,9 @@ module Icarus
|
|
|
9
9
|
module CLI
|
|
10
10
|
# Sync CLI command definitions
|
|
11
11
|
class Validate < SubcommandBase
|
|
12
|
+
# Warnings about loosely formed URLs and GitHub URLs we auto-fix; only shown with -v
|
|
13
|
+
NOISY_WARNING = /\AInvalid URL|Auto-fixed:/
|
|
14
|
+
|
|
12
15
|
desc "modinfo", "Reads modinfo data from 'meta/modinfo/list' and Validates syntax of modfiles"
|
|
13
16
|
def modinfo
|
|
14
17
|
validate(:modinfo)
|
|
@@ -39,37 +42,41 @@ module Icarus
|
|
|
39
42
|
exit 2
|
|
40
43
|
end
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
def validate(type)
|
|
44
|
-
exit_code = 0
|
|
45
|
-
validator = Icarus::Mod::Tools::Validator.new(type)
|
|
45
|
+
private
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
def validate(type)
|
|
48
|
+
exit_code = 0
|
|
49
|
+
hidden = 0
|
|
50
|
+
validator = Icarus::Mod::Tools::Validator.new(type)
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
puts "Validating Entries..." if verbose?
|
|
53
|
+
max_length = (validator.array.map { |info| info.uniq_name.length }.max || 0) + 1
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
validator.array.each do |info|
|
|
56
|
+
print Paint[format("%s %-#{max_length}s", "Running validation steps on", info.uniq_name), :cyan, :bright] if verbose > 1
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
end
|
|
58
|
+
info.validate
|
|
59
|
+
warnings = verbose > 1 ? info.warnings : info.warnings.grep_v(NOISY_WARNING)
|
|
60
|
+
hidden += info.warnings.size - warnings.size
|
|
59
61
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
puts "\n" if verbose > 1
|
|
65
|
-
end
|
|
62
|
+
unless info.errors? || warnings.any?
|
|
63
|
+
puts Paint["SUCCESS", :green, :bright] if verbose > 1
|
|
64
|
+
next
|
|
65
|
+
end
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
if info.errors?
|
|
68
|
+
exit_code = 1
|
|
69
|
+
puts Paint["ERROR", :red, :bright] if verbose? && verbose > 1
|
|
70
|
+
puts info.errors.map { |error| Paint["#{error} in #{info.uniq_name}", :red] }.join("\n")
|
|
69
71
|
puts "\n" if verbose > 1
|
|
70
72
|
end
|
|
71
|
-
|
|
73
|
+
|
|
74
|
+
puts Paint["WARNING", :yellow, :bright] if warnings.any? && verbose > 1
|
|
75
|
+
puts warnings.map { |warning| Paint["#{warning} in #{info.uniq_name}", :yellow] }.join("\n")
|
|
76
|
+
puts "\n" if verbose > 1
|
|
72
77
|
end
|
|
78
|
+
puts "#{hidden} URL/auto-fix warning#{"s" unless hidden == 1} hidden; run with -v to see them" if hidden.positive? && verbose?
|
|
79
|
+
exit exit_code
|
|
73
80
|
end
|
|
74
81
|
end
|
|
75
82
|
end
|
data/lib/icarus/mod/version.rb
CHANGED