-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Fix #301] Add new Minitest/Focus cop #302
Conversation
yea, thanks for the PR. I just have not had time to come back to it and sort out the tests. |
is there a good guide or doc on write an auto-correct method? I'm not sure it's a good idea in this case, but I'd like to know. IMO it may not be a good things to autocorrect because many, including me, leave |
The |
While it has not been released yet, the next release of RuboCop will enable control through |
Per the README, minitest-focus allows focusing by directly - by placing the focus on the same line, or indirectly, on the previous line, which sets a "trap", focusing the next test. I added an additional "bad" example showing both focus possibilities.
This is cool! I think an autocorrect for this is lower value, since usually only a single test will be focused, but I'll take a stab at autocorrecting. Is there anything I need to do to set this cop to AutoCorrect: contextual? |
776a314
to
445aed1
Compare
I've added auto-correction and tests are passing, but as I've never written one of these before, I don't know if I did it the best way, suggestions welcome. |
Oops! I was mistaken 🙇 You're correct!
Since |
Thanks! |
Follow up rubocop#302 (comment). This PR updates the dependency version to RuboCop 1.61, which supports `AutoCorrect: contextual`, and updates `Minitest/Focus`'s config. https://github.com/rubocop/rubocop/releases/tag/v1.61.0
Follow up rubocop#302 (comment). This PR updates the dependency version to RuboCop 1.61, which supports `AutoCorrect: contextual`, and updates `Minitest/Focus`'s config. https://github.com/rubocop/rubocop/releases/tag/v1.61.0
Follow up rubocop#302 (comment). This PR updates the dependency version to RuboCop 1.61, which supports `AutoCorrect: contextual`, and updates `Minitest/Focus`'s config. https://github.com/rubocop/rubocop/releases/tag/v1.61.0
Checks for focused tests in the formats supported by minitest-focus.
I decided not to add an auto-corrector because IME it gets in the way when using editor auto-formatting. When focusing a test and then saving the file while working on the focused test, the focus gets removed, running everything.
However, I could add this if others disagree.
Hat tip to @NewAlexandria for the original PR.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.