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

feat(cheatcodes): display warnings for deprecated cheatcodes #8883

Merged
merged 11 commits into from
Sep 20, 2024

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Sep 17, 2024

Motivation

  • display message for deprecated cheatcodes
  • cheatcodes with replacement set displays them in warning
    #[cheatcode(group = Json, status = Deprecated("keyExistsJson")]
  • single warning reported per test suite with deprecated cheatcodes collected from all tests
    image

Solution

@grandizzy grandizzy changed the title feat(cheatcode): disaply message for cheatcodes marked as deprecated feat(cheatcode): display message for cheatcodes marked as deprecated Sep 17, 2024
@grandizzy grandizzy marked this pull request as ready for review September 17, 2024 16:19
@DaniPopes
Copy link
Member

I would rather implement this as a hashset stored in cheatcodes struct and then reported after, it also should report the other statuses; this spams the logs as it's logged on each call

@DaniPopes DaniPopes changed the title feat(cheatcode): display message for cheatcodes marked as deprecated feat(cheatcodes): display message for cheatcodes marked as deprecated Sep 17, 2024
@grandizzy grandizzy marked this pull request as draft September 17, 2024 16:41
@grandizzy grandizzy changed the title feat(cheatcodes): display message for cheatcodes marked as deprecated [WIP] feat(cheatcodes): display message for cheatcodes marked as deprecated Sep 17, 2024
@grandizzy
Copy link
Collaborator Author

grandizzy commented Sep 18, 2024

I would rather implement this as a hashset stored in cheatcodes struct and then reported after, it also should report the other statuses; this spams the logs as it's logged on each call

@DaniPopes before adding support for fuzz and invariant kinds, can you ptal and lmk if that's inline with what you're thinking at 43fd48c

showing single warning per test suite as in
image

@grandizzy grandizzy changed the title [WIP] feat(cheatcodes): display message for cheatcodes marked as deprecated feat(cheatcodes): display message for cheatcodes marked as deprecated Sep 19, 2024
@grandizzy grandizzy marked this pull request as ready for review September 19, 2024 10:17
crates/cheatcodes/spec/src/function.rs Outdated Show resolved Hide resolved
crates/cheatcodes/src/lib.rs Outdated Show resolved Hide resolved
@grandizzy grandizzy changed the title feat(cheatcodes): display message for cheatcodes marked as deprecated feat(cheatcodes): display warning for cheatcodes marked as deprecated Sep 20, 2024
@grandizzy grandizzy changed the title feat(cheatcodes): display warning for cheatcodes marked as deprecated feat(cheatcodes): display warnings for deprecated cheatcodes Sep 20, 2024
@grandizzy grandizzy enabled auto-merge (squash) September 20, 2024 11:09
@grandizzy grandizzy merged commit 5725bcc into foundry-rs:master Sep 20, 2024
20 checks passed
rplusq pushed a commit to rplusq/foundry that referenced this pull request Sep 25, 2024
…-rs#8883)

* feat(cheatcode): disaply message for cheatcodes marked as deprecated

* Deprecated cheatcodes as hashset, displayed once per test suite

* Add deprecated cheatcode replacement attr

* Add support for fuzz and invariant tests

* Changes after review: add Deprecated(replacement)

* Update crates/cheatcodes/src/inspector.rs

Co-authored-by: DaniPopes <[email protected]>

* chore: touchups

* Fix CI

---------

Co-authored-by: DaniPopes <[email protected]>
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.

3 participants