Skip to content

Add a cop that prevents putting patch_gem_version in a conditional - #13

Merged
klaustopher merged 1 commit into
mainfrom
patch-cop
Oct 28, 2026
Merged

klaustopher merged 1 commit into
mainfrom
patch-cop

Conversation

@klaustopher

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

We had an issue where we wrapped a patch_gem_version call in a conditional, that checked if a constant is defined from the Gem. As the gem was not loaded in the test environment, the bump was not detected on CI, but instead it failed when the application was deployed to production.

This cop prevents wrapping the call to patch_gem_version in any conditionals. If conditionals need to apply, put them inside of the block.

AI involvement

Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@klaustopher
klaustopher merged commit 7b0a0fb into main Oct 28, 2026
4 checks passed
@klaustopher
klaustopher deleted the patch-cop branch October 28, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants