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

Improve deadcode plugin for Minitest #579

Merged
merged 3 commits into from
Jul 11, 2024
Merged

Improve deadcode plugin for Minitest #579

merged 3 commits into from
Jul 11, 2024

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jul 4, 2024

  • Make plugin ignore classes that inherit from Minitest::Test instead of those ending with Test
  • Modified the on_define_method method to ignore methods starting with test_ or included in the MINITEST_METHODS set only when inside a Minitest::Test subclass.
  • Define on_send to mark methods used in assert_predicate and refute_predicate as alive.

@Morriar Morriar added the enhancement New feature or request label Jul 4, 2024
@Morriar Morriar requested a review from andyw8 July 4, 2024 20:09
@Morriar Morriar self-assigned this Jul 4, 2024
@Morriar Morriar requested a review from a team as a code owner July 4, 2024 20:09
@Morriar Morriar requested a review from amomchilov July 4, 2024 20:09
Before we relied on the name ending with `Test` which is not as precise.

Signed-off-by: Alexandre Terrasa <[email protected]>
lib/spoom/deadcode/plugins/minitest.rb Outdated Show resolved Hide resolved
@Morriar Morriar force-pushed the at-deadcode-minitest branch from 8b9c675 to b0f50e1 Compare July 11, 2024 14:38
@Morriar Morriar merged commit b78cd0e into main Jul 11, 2024
8 checks passed
@Morriar Morriar deleted the at-deadcode-minitest branch July 11, 2024 14:47
Morriar added a commit that referenced this pull request Jul 30, 2024
Since we only index `.rb` files, the relationship between
`ActiveJob::TestCase` and `ActiveSupport::TestCase` and other intermediate
classes that may only exist in the RBI files isn't seen by Spoom...

Signed-off-by: Alexandre Terrasa <[email protected]>
Morriar added a commit that referenced this pull request Jul 30, 2024
Revert Improve deadcode plugin for Minitest #579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants