-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Auto correct of RSpec/ExampleWording crashes #402
Comments
That cop has a few inconsistencies:
|
Thanks for the report, @phansch! I added the
iirc, this is necessary for some cases of |
Slightly o/t, but this cop is a good argument for #232 or something kind of like it. I realized after implementing the repeated it behavior that it's a shame that the offenses can't easily be independently flagged or corrected. They do both belong to the idea of "example wording" though, so it didn't feel right to have a separate cop either. |
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading 'it' and 'should' case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased 'Should's, 'IT's, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves "shouldn't be" handling * original text: shouldn't be true * correction before: does not be true * correction after: is not true - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: should WISH ME LUCK, should WORRIES * corrections before: WISHs ME LUCK, WORRYs * corrections after: WISHES ME LUCK, WORRIES - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRIES` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRY` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRY` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting - Adds pluralization support for words ending in `z` * ex: `buzz` -> `buzzes`
- Fixes #402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRY` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting - Adds pluralization support for words ending in `z` * ex: `buzz` -> `buzzes`
@dgollahon I won't have more time for this unfortunately and I see you already have a PR open. Thanks for the quick response 🎉 |
- Fixes rubocop#402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRY` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting - Adds pluralization support for words ending in `z` * ex: `buzz` -> `buzzes`
- Fixes rubocop#402 - Previously the #on_block method would correctly flag cases of leading `it` and `should` case-insensitively by downcasing the docstring but in the autocorrect phase the message casing was left untouched which caused a nil bug for upper cased `Should`s, `IT`s, etc. - Prevents words starting with `should` from being flagged * ex: `it 'shoulders the burden' {}` - Improves `shouldn't be` handling * original docstring: `shouldn't be true` * correction before: `does not be true` * correction after: `is not true` - Fixes the pluralizer so that it is not confused by uppercase letters * original docstrings: `should WISH ME LUCK`, `should WORRY` * corrections before: `WISHs ME LUCK`, `WORRYs` * corrections after: `WISHES ME LUCK`, `WORRIES` - If a whole word being corrected is completely uppercase, the suffix appended will also be uppercase. If the word is mixed case, the lowercase suffix will be appended. - Performs general refactoring.enter the commit message for your changes. Lines starting - Adds pluralization support for words ending in `z` * ex: `buzz` -> `buzzes`
Hello! I have been using rubocop-rspec without any issues so far and like it a lot. However, today I started to use it on a bigger project and I found the following example that crashes the auto correct:
If I run it without the autocorrect, the offense is registered correctly:
However, it breaks with the
--auto-correct
flag:I guess that's because
replacement_text
returnsnil
in that case. I probably have time to look into a fix later today.The text was updated successfully, but these errors were encountered: