Skip to content

1.9.2#263

Merged
digitalghost-dev merged 11 commits intomainfrom
1.9.2
Apr 12, 2026
Merged

1.9.2#263
digitalghost-dev merged 11 commits intomainfrom
1.9.2

Conversation

@digitalghost-dev
Copy link
Copy Markdown
Owner

@digitalghost-dev digitalghost-dev commented Apr 12, 2026

Summary by CodeRabbit

  • New Features

    • Pokémon summaries now show Gender Rate, Egg Cycles, and Effort Values.
    • Improved command error messages with clearer, styled multi-line prompts.
  • Chores

    • Project, packaging, and Docker image versions bumped to v1.9.2.
    • Documentation and examples updated to the new version.
    • CI adjusted to run on pull requests (push trigger removed for certain paths).
    • Test golden outputs updated to include the new Pokémon fields.
  • Security

    • Content-Security-Policy updated to allow connections to the GitHub API.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7759a4cc-ca29-4df0-8835-d1a53891fe31

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5f6d2 and ef41f76.

📒 Files selected for processing (1)
  • cmd/pokemon/pokemon.go
✅ Files skipped from review due to trivial changes (1)
  • cmd/pokemon/pokemon.go

📝 Walkthrough

Walkthrough

Bumps release/version metadata to v1.9.2 across CI, packaging, and docs; adds Gender Rate, Egg Cycles, and Effort Values to Pokémon CLI output (with corresponding struct fields and golden test updates); and replaces a short argument-error message with a styled multi-line error block.

Changes

Cohort / File(s) Summary
Version Bump & Release Metadata
/.github/workflows/ci.yml, /.goreleaser.yml, Dockerfile, /nfpm.yaml, /web/pyproject.toml, /README.md, /card_data/pipelines/poke_cli_dbt/dbt_project.yml
Updated version/image tags and build ldflags from v1.9.0/v1.9.1 → v1.9.2 across CI, release, Docker, package manifests, README, and dbt project.
CLI Output & Data Model
cmd/pokemon/pokemon.go, structs/structs.go
Replaced egg-group-only generator with expanded egg-information block; added Effort to stat entries and GenderRate/HatchCounter to species struct; added formatted "Gender Rate", "Egg Cycles", and "Effort Values" to CLI output.
Argument Validation UX
cmd/utils/validateargs.go
Replaced single-line insufficient-arguments error with a multi-line, styled error message using styling.ErrorBorder/styling.ErrorColor and hint lines.
Golden Test Updates
testdata/*.golden, testdata/main_latest_flag.golden
Updated multiple golden outputs to include new metadata lines (Gender Rate, Egg Cycles, Effort Values) and adjusted displayed release version in main_latest_flag.
CI/Workflow & Config Tweaks
/.github/workflows/python_testing.yml, /docs/nginx.conf
Removed push trigger from python testing workflow; relaxed Nginx CSP connect-src to allow https://api.github.com.
Minor Refactor
structs/structs.go
Condensed several GetResourceName() methods to single-line returns without behavior change.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • 1.7.1 #189: Modifies Pokémon output and underlying structs — directly related to the CLI output and struct field changes.
  • 1.8.10 #246: Touches argument validation and error handling — related to the styled ValidateArgs error changes.
  • 1.8.1 #211: Performs matching release/version bumps across CI and packaging files similar to this PR.

Poem

🐰 I hopped from one-nine-one to one-nine-two,
Eggs and genders, EVs shining through,
Errors framed with borders neat and bright,
Golden tests updated — what a delightful sight! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '1.9.2' is vague and does not clearly convey what changes were made; it only indicates a version number without describing the actual modifications. Consider using a descriptive title like 'Release version 1.9.2' or 'Bump version to 1.9.2 and add Pokemon stat fields' that better explains the changes and their purpose.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1.9.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 12, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing 1.9.2 (ef41f76) with main (a935015)

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 89.18919% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
structs/structs.go 0.00% 6 Missing ⚠️
cmd/pokemon/pokemon.go 96.72% 1 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
cmd/utils/validateargs.go 83.78% <100.00%> (+1.43%) ⬆️
cmd/pokemon/pokemon.go 89.44% <96.72%> (+1.41%) ⬆️
structs/structs.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

115-121: ⚠️ Potential issue | 🟡 Minor

Update stale Docker image tag references to v1.9.2.

The Docker commands in this NOTE section still reference v1.9.1 instead of v1.9.2. These should be updated for consistency with the other Docker references updated in this PR (lines 5, 102, 106).

🐛 Proposed fix
 > # Kitty
-> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.2 card
 >
 > # WezTerm, iTerm2, Ghostty, Konsole, Rio, Tabby
-> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.2 card
 >
 > # Windows Terminal (Sixel)
-> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.2 card
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 115 - 121, Update the three docker run examples that
currently use the image tag digitalghostdev/poke-cli:v1.9.1 to use v1.9.2
instead; specifically replace v1.9.1 with v1.9.2 in the lines beginning with
"docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1
card", "docker run --rm -it -e TERM -e TERM_PROGRAM
digitalghostdev/poke-cli:v1.9.1 card", and "docker run --rm -it -e WT_SESSION
digitalghostdev/poke-cli:v1.9.1 card" so they become consistent with the other
updated Docker references.
🧹 Nitpick comments (2)
cmd/utils/validateargs.go (1)

45-45: Prefer neutral phrasing for the missing-name message.

"a(n) %s's name" reads awkwardly for some command names. A neutral template is cleaner and more reusable.

Proposed wording tweak
-			fmt.Sprintf("\nPlease declare a(n) %s's name after the <%s> command", v.CmdName, v.CmdName),
+			fmt.Sprintf("\nPlease provide the required name after the <%s> command", v.CmdName),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/utils/validateargs.go` at line 45, Replace the awkward "a(n) %s's name"
phrasing with a neutral template: update the format string that builds the
missing-name message (where fmt.Sprintf is called with v.CmdName twice) to
something like "Please provide a name for %s when using the <%s> command" so it
references v.CmdName and the command token cleanly; adjust the fmt.Sprintf call
that constructs the message to use this new template.
cmd/pokemon/pokemon.go (1)

99-113: Avoid rebuilding modernEggInformationNames inside the loop.
Define the map once before iterating to reduce redundant allocations.

♻️ Proposed refactor
-		for _, entry := range pokemonSpeciesStruct.EggGroups {
-			modernEggInformationNames := map[string]string{
-				"indeterminate": "Amorphous",
-				"ground":        "Field",
-				"humanshape":    "Human-Like",
-				"plant":         "Grass",
-				"no-eggs":       "Undiscovered",
-			}
+		modernEggInformationNames := map[string]string{
+			"indeterminate": "Amorphous",
+			"ground":        "Field",
+			"humanshape":    "Human-Like",
+			"plant":         "Grass",
+			"no-eggs":       "Undiscovered",
+		}
+
+		for _, entry := range pokemonSpeciesStruct.EggGroups {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/pokemon/pokemon.go` around lines 99 - 113, The map
modernEggInformationNames is being recreated on every iteration of the loop over
pokemonSpeciesStruct.EggGroups; move its declaration out of the loop and define
it once before the for _, entry := range pokemonSpeciesStruct.EggGroups loop
(either as a local variable just above the loop or as a package-level var if
appropriate), then inside the loop simply look up entry.Name and append to
eggInformationSlice (falling back to
cases.Title(language.English).String(entry.Name) when missing).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/pokemon/pokemon.go`:
- Around line 118-165: The gender and stat label lookups can produce blank
strings for unexpected keys; update the gender handling around
pokemonSpeciesStruct.GenderRate (map m) to use a safe lookup (val, ok :=
m[genderRate]) and set a clear fallback like "Unknown" or a formatted numeric
label when !ok; likewise in the effortValues closure use a safe lookup from
nameMapping for effortValue.Stat.Name (name, ok := nameMapping[...]) and when
missing fall back to a readable form (e.g., the original stat name or a
Title-cased version) before appending to evs so no empty labels are emitted.

In `@docs/nginx.conf`:
- Line 6: Remove the unnecessary GitHub API allowance from the
Content-Security-Policy add_header directive: edit the add_header
Content-Security-Policy line to drop "https://api.github.com" from the
connect-src list since the site does not call the GitHub API; if you later add a
feature that requires GitHub API access, re-add that origin and include an
inline comment on the same add_header line explaining why it is required.

---

Outside diff comments:
In `@README.md`:
- Around line 115-121: Update the three docker run examples that currently use
the image tag digitalghostdev/poke-cli:v1.9.1 to use v1.9.2 instead;
specifically replace v1.9.1 with v1.9.2 in the lines beginning with "docker run
--rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1 card",
"docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.1
card", and "docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.1
card" so they become consistent with the other updated Docker references.

---

Nitpick comments:
In `@cmd/pokemon/pokemon.go`:
- Around line 99-113: The map modernEggInformationNames is being recreated on
every iteration of the loop over pokemonSpeciesStruct.EggGroups; move its
declaration out of the loop and define it once before the for _, entry := range
pokemonSpeciesStruct.EggGroups loop (either as a local variable just above the
loop or as a package-level var if appropriate), then inside the loop simply look
up entry.Name and append to eggInformationSlice (falling back to
cases.Title(language.English).String(entry.Name) when missing).

In `@cmd/utils/validateargs.go`:
- Line 45: Replace the awkward "a(n) %s's name" phrasing with a neutral
template: update the format string that builds the missing-name message (where
fmt.Sprintf is called with v.CmdName twice) to something like "Please provide a
name for %s when using the <%s> command" so it references v.CmdName and the
command token cleanly; adjust the fmt.Sprintf call that constructs the message
to use this new template.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e430c8f-c52b-4f76-ac28-3104173472ca

📥 Commits

Reviewing files that changed from the base of the PR and between a935015 and 835969f.

📒 Files selected for processing (22)
  • .github/workflows/ci.yml
  • .github/workflows/python_testing.yml
  • .goreleaser.yml
  • Dockerfile
  • README.md
  • card_data/pipelines/poke_cli_dbt/dbt_project.yml
  • cmd/pokemon/pokemon.go
  • cmd/utils/validateargs.go
  • docs/nginx.conf
  • nfpm.yaml
  • structs/structs.go
  • testdata/main_latest_flag.golden
  • testdata/pokemon_abilities.golden
  • testdata/pokemon_defense.golden
  • testdata/pokemon_defense_ability_immunities.golden
  • testdata/pokemon_image.golden
  • testdata/pokemon_image_flag_non-valid_size.golden
  • testdata/pokemon_no_flags_dual_type.golden
  • testdata/pokemon_regional_form.golden
  • testdata/pokemon_regional_form_2.golden
  • testdata/pokemon_stats.golden
  • web/pyproject.toml
💤 Files with no reviewable changes (1)
  • .github/workflows/python_testing.yml

Comment thread cmd/pokemon/pokemon.go
Comment thread docs/nginx.conf
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
cmd/pokemon/pokemon.go (1)

118-167: ⚠️ Potential issue | 🟡 Minor

Add safe fallbacks for derived output fields.

Line 139 can render an empty gender value for unmapped GenderRate, and Line 167 can render a blank Effort Values: when no EVs exist.

🛡️ Proposed robustness fix
 		genderRate := pokemonSpeciesStruct.GenderRate
 		m := map[int]string{
@@
 		}
+		genderRateText, ok := m[genderRate]
+		if !ok {
+			genderRateText = "Unknown"
+		}
@@
 		fmt.Fprintf(w,
 			"\n%s %s %s\n%s %s %s\n%s %s %d",
@@
-			"Gender Rate:", m[genderRate],
+			"Gender Rate:", genderRateText,
@@
 		for _, effortValue := range pokemonStruct.Stats {
@@
 		}
 
-		fmt.Fprintf(w, "\n%s Effort Values: %s", styling.ColoredBullet, strings.Join(evs, ", "))
+		if len(evs) == 0 {
+			fmt.Fprintf(w, "\n%s Effort Values: None", styling.ColoredBullet)
+			return
+		}
+		fmt.Fprintf(w, "\n%s Effort Values: %s", styling.ColoredBullet, strings.Join(evs, ", "))
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/pokemon/pokemon.go` around lines 118 - 167, The output can show
empty/missing values: when rendering gender rate use a safe lookup for
genderRate against the map m (e.g., check if m[genderRate] exists and fall back
to "Unknown" or "Genderless" instead of indexing blindly) and update the
fmt.Fprintf call that prints Gender Rate to use that fallback; similarly in the
effortValues function, if the evs slice is empty, render a clear fallback like
"None" (or "0") instead of joining an empty slice so the "Effort Values:" line
is never blank; reference symbols to change: genderRate, m, the fmt.Fprintf that
prints Gender Rate, effortValues, evs, and the fmt.Fprintf that prints Effort
Values.
🧹 Nitpick comments (1)
cmd/pokemon/pokemon.go (1)

99-107: Hoist static egg-name mapping out of the loop.

modernEggInformationNames is recreated on every iteration. Defining it once before the loop is cleaner and avoids repeated allocations.

♻️ Proposed refactor
-		for _, entry := range pokemonSpeciesStruct.EggGroups {
-			modernEggInformationNames := map[string]string{
-				"indeterminate": "Amorphous",
-				"ground":        "Field",
-				"humanshape":    "Human-Like",
-				"plant":         "Grass",
-				"no-eggs":       "Undiscovered",
-			}
+		modernEggInformationNames := map[string]string{
+			"indeterminate": "Amorphous",
+			"ground":        "Field",
+			"humanshape":    "Human-Like",
+			"plant":         "Grass",
+			"no-eggs":       "Undiscovered",
+		}
+		for _, entry := range pokemonSpeciesStruct.EggGroups {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/pokemon/pokemon.go` around lines 99 - 107, The map
modernEggInformationNames is being reallocated inside the loop over
pokemonSpeciesStruct.EggGroups; move its declaration out of the loop so it's
created once and reused. Specifically, define modernEggInformationNames (the
mapping from "indeterminate","ground","humanshape","plant","no-eggs" to their
modern names) before the for _, entry := range pokemonSpeciesStruct.EggGroups
loop and then use that single map instance inside the loop when processing each
entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@cmd/pokemon/pokemon.go`:
- Around line 118-167: The output can show empty/missing values: when rendering
gender rate use a safe lookup for genderRate against the map m (e.g., check if
m[genderRate] exists and fall back to "Unknown" or "Genderless" instead of
indexing blindly) and update the fmt.Fprintf call that prints Gender Rate to use
that fallback; similarly in the effortValues function, if the evs slice is
empty, render a clear fallback like "None" (or "0") instead of joining an empty
slice so the "Effort Values:" line is never blank; reference symbols to change:
genderRate, m, the fmt.Fprintf that prints Gender Rate, effortValues, evs, and
the fmt.Fprintf that prints Effort Values.

---

Nitpick comments:
In `@cmd/pokemon/pokemon.go`:
- Around line 99-107: The map modernEggInformationNames is being reallocated
inside the loop over pokemonSpeciesStruct.EggGroups; move its declaration out of
the loop so it's created once and reused. Specifically, define
modernEggInformationNames (the mapping from
"indeterminate","ground","humanshape","plant","no-eggs" to their modern names)
before the for _, entry := range pokemonSpeciesStruct.EggGroups loop and then
use that single map instance inside the loop when processing each entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 31b0c460-6cdc-4740-8a80-25c997ecd689

📥 Commits

Reviewing files that changed from the base of the PR and between 835969f and 4b5f6d2.

📒 Files selected for processing (2)
  • README.md
  • cmd/pokemon/pokemon.go
✅ Files skipped from review due to trivial changes (1)
  • README.md

@digitalghost-dev digitalghost-dev merged commit 224bfd3 into main Apr 12, 2026
11 checks passed
@digitalghost-dev digitalghost-dev deleted the 1.9.2 branch April 12, 2026 18:28
@digitalghost-dev digitalghost-dev restored the 1.9.2 branch April 14, 2026 17:58
@digitalghost-dev digitalghost-dev deleted the 1.9.2 branch April 14, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add effort value given Add egg cycle and gender ratio information Fix error message for various commands feature request: Egg/Breeding info

1 participant