Issue 3458#3487
Conversation
…tivate" cause this the right way to run shell command in 2.0.0+
…ber of lines to counting the number of statements. It now works the same way as the try block. This allows using a single function with many arguments or a function with a long name that splits across multiple lines. Option "max-lines-in-finally" renamed to "max-finally-body-length" to follow new logic.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3487 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 364 363 -1
Lines 12040 12032 -8
Branches 823 822 -1
=========================================
- Hits 12040 12032 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ### Bugfixes | ||
|
|
||
| - Fixes `WPS243` to use number of statements in `finally` body instead of a number of lines, #3458 | ||
| - Rename `--max-lines-in-finally` option to `--max-finally-body-length`, #3458 |
There was a problem hiding this comment.
This is a breaking change :(
Sadly, we can't do that. Please, revert.
There was a problem hiding this comment.
May I keep the old name for the option but use the new one inside code? The new name follows the same pattern as try violation. Or rename internal variable as well?
There was a problem hiding this comment.
I also had to set the default value = 2 to support backward compatibility. It is slightly looser strictness than for the try body.
There was a problem hiding this comment.
fixed one more time =) now should be fine.
|
|
||
| Configuration: | ||
| This rule is configurable with ``--max-lines-in-finally``. | ||
| This rule is configurable with ``--max-finally-body-length``. |
There was a problem hiding this comment.
We can solve this problem with better docs. We can explain what "line" means here. It basically means "statement"
98639b1 to
c0995dd
Compare
…pport backward compatibility
c0995dd to
b66e680
Compare
sobolevn
left a comment
There was a problem hiding this comment.
Thank you for the quick fix! I will release this tomorrow 🤝
I have made things!
Checklist
CHANGELOG.mdRelated issues
Comment
The previous solution used a number of lines to determine finally block complexity, which works purely with a function with multiple arguments or a function with a long name. New logic uses the same logic as try body violation: at most one statement.
Docs
I also changed
poetry shellcommand in docs cause it was change since 2.0.0 version