You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't warn about magic trailing comma when isort.force-single-line is true (#8244)
## Summary
Based on [this
feedback](#8185 (comment)).
Avoid warning about `force-wrap-aliases` and `split-on-trailing-comma`
if `force-single-line` is true (which creates a dedicated import for
each imported member).
## Test Plan
Ran `ruff format . --no-cache` and verified that the warning show up
when `force-single-line=false` and aren't shown when
`force-single-line=true`
// isort inserts a trailing comma which the formatter preserves, but only if `skip-magic-trailing-comma` isn't false.
795
-
if setting.formatter.magic_trailing_comma.is_ignore(){
795
+
// This isn't relevant when using `force-single-line`, since isort will never include a trailing comma in that case.
796
+
if setting.formatter.magic_trailing_comma.is_ignore()
797
+
&& !setting.linter.isort.force_single_line
798
+
{
796
799
if setting.linter.isort.force_wrap_aliases{
797
800
warn!("The isort option `isort.force-wrap-aliases` is incompatible with the formatter `format.skip-magic-trailing-comma=true` option. To avoid unexpected behavior, we recommend either setting `isort.force-wrap-aliases=false` or `format.skip-magic-trailing-comma=false`.");
0 commit comments