Skip to content
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

Decide and impose a hard line limit #610

Closed
maresb opened this issue Jan 20, 2024 · 6 comments
Closed

Decide and impose a hard line limit #610

maresb opened this issue Jan 20, 2024 · 6 comments

Comments

@maresb
Copy link
Contributor

maresb commented Jan 20, 2024

Description

Despite reviewing #586 I'm only now realizing that we have an ignore on E501 "line too long".

The formatter will reformat lines to have width 88 when automatically possible, but there doesn't seem to be any other mechanism for complaining about long lines that can't be autoformatted. Is this accidental or deliberate?

My concern is that without a hard line limit, long lines tend to accumulate in a codebase, and then it becomes a huge chore if you want to fix them at some point.

@ricardoV94
Copy link
Member

We can add but perhaps not 88. What's the norm these days 120?

@maresb
Copy link
Contributor Author

maresb commented Jan 21, 2024

I personally use 88 and almost all projects I know also use 88. My main motivation is that diffs with long lines are hard to read, especially on a laptop screen.

If it doesn't bother you then probably it's not a problem. The problem is only when you want a limit but it's not enforced.

@maresb maresb closed this as completed Jan 21, 2024
@ricardoV94
Copy link
Member

We can have a limit I am not against it. I thought we had one already.

Just find 88 very restrictive

@maresb maresb changed the title Is it intentional to have no hard line limit? Decide and impose a hard line limit Jan 21, 2024
@maresb
Copy link
Contributor Author

maresb commented Jan 21, 2024

Ok, I will look into this soon. We can start with a very long hard limit and reduce it to taste.

@maresb maresb reopened this Jan 21, 2024
@lucianopaz
Copy link
Contributor

I think that the ignore was added to ignore long lines in docstrings. The auto-formatter will fix the code part that gets long lines, but doesn't deal with long strings or multi line strings like docstrings. Sometimes, it's good for docstrings to be long lines (specially when you add tables or fancy markdown things in the middle), so it's ok to have the ignore in those cases

@ricardoV94 ricardoV94 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@ricardoV94
Copy link
Member

From the last comment I concluded this was not a problem. Feel free to reopen if I misinterpreted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants