-
Notifications
You must be signed in to change notification settings - Fork 18
feat: everything 2.1 removes warns in 2.0, and nothing is silent #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ module Deprecation | |
| @seen = {} | ||
| @notified = false | ||
| @notice_suppressed = false | ||
| @canonical_entry = false | ||
|
|
||
| # The ONE line a v1 user gets, whichever door they came through. Most of | ||
| # the v1 surface cannot warn per use -- the config accessors are plain | ||
|
|
@@ -60,6 +61,36 @@ def notice | |
| Kernel.warn(MIGRATION_NOTICE) if first_time | ||
| end | ||
|
|
||
| # @api private | ||
| # | ||
| # Called at the TOP of every v1-NAMED entry file, before that file's | ||
| # own requires. Requiring one of those paths IS use of the v1 API, | ||
| # and it is the ONE door a suite that merely calls `screenshot` goes | ||
| # through: every other door ({LEGACY_DOORS} in the probe test) needs | ||
| # the user to call something, which is how beta3 shipped a v1-only | ||
| # app that produced zero deprecation output. | ||
| # | ||
| # Position matters. The marker must run before the file's requires, | ||
| # because lib/capybara-screenshot-diff.rb reaches the canonical entry | ||
| # point below on its way in, and a marker placed after that require | ||
| # would be swallowed by {canonical_entry_point!}. | ||
| # @return [void] | ||
| def legacy_entry_point! | ||
| notice unless @canonical_entry | ||
| end | ||
|
Comment on lines
+78
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Scope canonical suppression to the internal umbrella load. When a process first requires Use a scoped canonical-load marker, and clear it with 🤖 Prompt for AI Agents |
||
|
|
||
| # @api private | ||
| # | ||
| # Claimed by lib/snap_diff-capybara.rb -- the canonical gem-name | ||
| # entry -- which loads the v1 umbrella itself. Without this, "the v1 | ||
| # files got loaded" would be indistinguishable from "a v1 user", and | ||
| # every `gem "snap_diff-capybara"` app would be told to migrate off | ||
| # an API it never touched. | ||
| # @return [void] | ||
| def canonical_entry_point! | ||
| @canonical_entry = true | ||
| end | ||
|
|
||
| # @api private | ||
| # | ||
| # Suppresses {MIGRATION_NOTICE} for the rest of the process, without | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Set a language for this fenced block.
markdownlint reports MD040 for this fence. Use
textbecause the block contains warning output.🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 286-286: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Source: Linters/SAST tools