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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f71d742763b16a7a6cb096f6decf06568f415909ee0830f392315523b7ab307d
4
- data.tar.gz: f5afb462e86cc8452508dad64b319d4c2246cad20a5963741efa43f2b76d873a
3
+ metadata.gz: d922315481e0b1bd34f88773cf5ea5e49ec1117ad58ec9239643379581796752
4
+ data.tar.gz: 496323127ce64f211a3ccfdf38e33c8a77ff07700ad7138c87507ccf79bd03d5
5
5
  SHA512:
6
- metadata.gz: 96c885457a5b1e1998eea60852d62474a48c4b1b66ec4ccd4aede80f8300314bde8eb2e9cca637cdae7d6630e00d83fa33b0157af899ef50283e3a97760c25ee
7
- data.tar.gz: deac9280f7a685695dbe3704ae48b990298a4559b3dd1d5cd5277bb51fef6fe92ab71f0fc8bfb05dda43a6a170c430729c4fac7b5e5f0f291d29f627ead1dba9
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Icarus-Mod-Tools (3.2.1)
4
+ Icarus-Mod-Tools (3.2.2)
5
5
  google-cloud-firestore (~> 3.3)
6
6
  octokit (~> 10.0)
7
7
  ostruct (~> 0.6)
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
- def check_false
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
- check_false
21
- options[:verbose]&.count || 0
17
+ flags = options[:verbose] || []
18
+ flags.include?(false) ? 0 : flags.count
22
19
  end
23
20
 
24
21
  def verbose?
25
- check_false
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
- no_commands do
43
- def validate(type)
44
- exit_code = 0
45
- validator = Icarus::Mod::Tools::Validator.new(type)
45
+ private
46
46
 
47
- puts "Validating Entries..." if verbose?
48
- max_length = (validator.array.map { |info| info.uniq_name.length }.max || 0) + 1
47
+ def validate(type)
48
+ exit_code = 0
49
+ hidden = 0
50
+ validator = Icarus::Mod::Tools::Validator.new(type)
49
51
 
50
- validator.array.each do |info|
51
- print Paint[format("%s %-#{max_length}s", "Running validation steps on", info.uniq_name), :cyan, :bright] if verbose > 1
52
+ puts "Validating Entries..." if verbose?
53
+ max_length = (validator.array.map { |info| info.uniq_name.length }.max || 0) + 1
52
54
 
53
- info.validate
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
- unless info.errors? || info.warnings?
56
- puts Paint["SUCCESS", :green, :bright] if verbose > 1
57
- next
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
- if info.errors?
61
- exit_code = 1
62
- puts Paint["ERROR", :red, :bright] if verbose? && verbose > 1
63
- puts info.errors.map { |error| Paint["#{error} in #{info.uniq_name}", :red] }.join("\n")
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
- puts Paint["WARNING", :yellow, :bright] if info.warnings.any? && verbose > 1
68
- puts info.warnings.map { |warning| Paint["#{warning} in #{info.uniq_name}", :yellow] }.join("\n")
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
- exit exit_code
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Icarus
4
4
  module Mod
5
- VERSION = "3.2.1"
5
+ VERSION = "3.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Icarus-Mod-Tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan Young