PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.53k stars 583 forks source link

`wemake` profile inconsistency: 80 vs 79 line length #2182

Closed skatromb closed 11 months ago

skatromb commented 1 year ago

I am using wemake-python-styleguide linter, which states "80" line length. However, its real limit is 79, after which isort should proceeding with newline for long import. I found that with the following line of code:

from typing import Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union

It passes isort with wemake profile, but wemake throws error: python_file.py:1:80: E501 line too long (80 > 79 characters) Need to fix profile config and add test (will be done)

skatromb commented 1 year ago

Made PR

staticdev commented 11 months ago

Merged.

sobolevn commented 9 months ago

This actually cause a regression in almost all of my projects :) I've spent multiple hours digging into it.

The real value is max-line-length = 80 Here's the proof: https://github.com/wemake-services/wemake-python-styleguide/actions/runs/8076865527/job/22066047320?pr=2864

I will send a PR to revert this change. Please, ping me if you want to change this next time :)

skatromb commented 9 months ago

Ah, my bad and apologies. That was my misconfiguration of wps with ruff and isort. I'll be more thorough next time.

sobolevn commented 9 months ago

No worries :) Very cool bug to remember! 🤗