-
Notifications
You must be signed in to change notification settings - Fork 16
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
New sniff to detect correct setUp/tearDown parent calls #165
Conversation
These are the results when executing it against core (4.5dev). 492 cases detected and fixed. Ciao :-) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
============================================
+ Coverage 97.93% 97.99% +0.06%
- Complexity 860 886 +26
============================================
Files 38 39 +1
Lines 2564 2647 +83
============================================
+ Hits 2511 2594 +83
Misses 53 53 ☔ View full report in Codecov by Sentry. |
87cd2e6
to
a1d52e9
Compare
It detects various situations like: - Missing calls to parent. - Dupe calls. - Incorrect calls. And, when possible, tries to fix the missing ones (not others) by adding them in a correct place: - For setUp cases, at the beginning of the method. - For tearDown cases, at the end of the method. Of course, covered with tests. Fixes moodlehq#106
a1d52e9
to
6a458cb
Compare
Thanks @andrewnicols , I've cherry-picked your commit here, and applied a few small (comments, problem cases) modifications to it, to better understand what's going with those empty methods. I think this now is perfect! 😎 |
It detects various situations like:
And, when possible, tries to fix the missing ones (not others) by adding them in a correct place:
Only for 405 and above.
Of course, covered with tests.
Fixes #106
Note that this is built on top of #162.