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

Flake8 line limit is inconsistent with Black #2975

Open
freakboy3742 opened this issue Nov 20, 2024 · 4 comments · May be fixed by #2993
Open

Flake8 line limit is inconsistent with Black #2975

freakboy3742 opened this issue Nov 20, 2024 · 4 comments · May be fixed by #2993
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

Toga's flake8 configuration (set in tox.ini because of... reasons) enforces a line length of 119. However, Black format enforces an 88 character limit. So - our code is being formatted to 88 character lines, but that won't format some comments and strings, which can lead to PRs that don't auto-flag a formatting issue.

Describe the solution you'd like

Toga's flake8 configuration should set an 88 characters limit (to match Black).

Existing code that exceeds the 88 character limit should be reformatted.

Describe alternatives you've considered

None.

Additional context

After changing the tox.ini configuration, pre-commit run --all will highlight all the problem lines.

Some of the lines are long for historical reasons - Rubicon didn't historically [have a way to deal with ObjC methods with duplicated argument names (see beeware/rubicon-objc#148). However, this was fixed in Rubicon 0.4.9, and some code has already been updated to use the new syntax (see #2682). That syntax can now be used everywhere to avoid long lines.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start! labels Nov 20, 2024
@freakboy3742
Copy link
Member Author

As noted on beeware/briefcase#2064, adopting Ruff would also resolve the inconsistency. That's a separate decision to be made; but resolving outstanding > 89 character lines will be at least a co-requisite.

@garthk
Copy link

garthk commented Nov 25, 2024

👋 I'm helping @nitschkek on this one. Thought about asking whether you'd take Ruff but yeah thought that'd best be left for a subsequent change.

@freakboy3742
Copy link
Member Author

@garthk Looks like we've had a collision on the committer highway - @marcbradshaw has just submitted a PR that implements a fix for this...

marcbradshaw added a commit to marcbradshaw/toga that referenced this issue Nov 25, 2024
@nitschkek
Copy link

nitschkek commented Nov 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants