Skip to content
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

Make deprecator messaging clearer #125

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

eileencodes
Copy link
Member

The deprecator messaging was confusing when outputting deprecations, especially if one was removed. The way this was written previously it would appear like the deprecator was looping - saying a deprecation was removed and then immediately showing the deprecation. To make the messaging clearer and to distinguish it from a deprecation that is being thrown, put copy around the deprecations.

Before:

Minitest::UnexpectedError: DeprecationToolkit::Behaviors::DeprecationRemoved: You have removed deprecations from the codebase. Thanks for being an awesome person.
The recorded deprecations needs to be updated to reflect your changes.
You can re-record deprecations by adding the `--record-deprecations` flag when running your tests.

DEPRECATION WARNING: a deprecation warning

After:

Minitest::UnexpectedError: DeprecationToolkit::Behaviors::DeprecationRemoved: You have removed deprecations from the codebase. Thanks for being an awesome person.
The recorded deprecations needs to be updated to reflect your changes.
You can re-record deprecations by adding the `--record-deprecations` flag when running your tests.

****** The following deprecations were removed: ******
DEPRECATION WARNING: a deprecation warning
******************************************************

@eileencodes eileencodes force-pushed the fix-removed-deprecation-warning branch from f97a44b to 0dfa1b5 Compare January 21, 2025 17:31
The deprecator messaging was confusing when outputting deprecations,
especially if one was removed. The way this was written previously it
would appear like the deprecator was looping - saying a deprecation was
removed and then immediately showing the deprecation. To make the
messaging clearer and to distinguish it from a deprecation that is being
thrown, put copy around the deprecations.

Before:

```
Minitest::UnexpectedError: DeprecationToolkit::Behaviors::DeprecationRemoved: You have removed deprecations from the codebase. Thanks for being an awesome person.
The recorded deprecations needs to be updated to reflect your changes.
You can re-record deprecations by adding the `--record-deprecations` flag when running your tests.

DEPRECATION WARNING: a deprecation warning
```

After:

```
Minitest::UnexpectedError: DeprecationToolkit::Behaviors::DeprecationRemoved: You have removed deprecations from the codebase. Thanks for being an awesome person.
The recorded deprecations needs to be updated to reflect your changes.
You can re-record deprecations by adding the `--record-deprecations` flag when running your tests.

****** The following deprecations were removed: ******
DEPRECATION WARNING: a deprecation warning
******************************************************
```

Note that I also fixed a test name where "triggered" was spelled
incorrectly.
@etiennebarrie etiennebarrie force-pushed the fix-removed-deprecation-warning branch from 0dfa1b5 to bbc1c46 Compare January 22, 2025 15:53
@etiennebarrie etiennebarrie merged commit 6be1a50 into main Jan 22, 2025
39 checks passed
@etiennebarrie etiennebarrie deleted the fix-removed-deprecation-warning branch January 22, 2025 16:03
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.

None yet

3 participants