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

Make Flake8 line limit consistent with Black and shorten lines to comply #2993

Merged
merged 10 commits into from
Nov 28, 2024

Conversation

marcbradshaw
Copy link
Contributor

Flake8 line limit is inconsistent with Black, this PR updates the config to be consistent, and shortens lines to comply with the new limit, as required.

Some lines with very long method names were skipped, ironically by making them even longer and adding a noqa comment

Fixes #2975

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@marcbradshaw marcbradshaw force-pushed the 2975-flake8-line-limit branch 3 times, most recently from 341380c to ab46261 Compare November 25, 2024 07:20
This makes it consistent with the limit set in Black.
@marcbradshaw marcbradshaw force-pushed the 2975-flake8-line-limit branch from 65140d7 to c99058f Compare November 26, 2024 03:40
@freakboy3742
Copy link
Member

Those CI failures are mine - I'll get them fixed.

@mhsmith
Copy link
Member

mhsmith commented Nov 26, 2024

Please do not use a force push to alter commits which have already been reviewed, as it breaks the "Show changes since your last review" feature in GitHub. If you need to bring in changes from the main branch, you can use a merge rather than a rebase.

@mhsmith
Copy link
Member

mhsmith commented Nov 26, 2024

There's no consistency in the line lengths of the comments. For example:

  • android/src/toga_android/widgets/label.py was previously 88 columns and has been reduced to 80.
  • android/src/toga_android/libs/events.py was previously 95 columns and has been reduced to 88.
  • cocoa/src/toga_cocoa/window.py was previously 88 columns and has been reduced to 60.

To avoid unnecessary noise and merge conflicts, I think we should do the following:

  • If code is longer than 88 columns, reduce it to 88.
  • If code is shorter than 88 columns, leave it unchanged.

Previous discussion: #2956 (comment)

@freakboy3742
Copy link
Member

Agreed about the general guidelines - but:

  • android/src/toga_android/widgets/label.py was previously 88 columns and has been reduced to 80.

There's only 1 change in this file, and it's because the first line is 89 chars. The new flow ends up with the second line being 88 chars. Have I misunderstood what you're referring to?

  • android/src/toga_android/libs/events.py was previously 95 columns and has been reduced to 88.

Agreed.... but that's what we want, right?

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - I've undone the damage I did yesterday 🤦 , and I've made a bunch of other tweaks following @mhsmith's notes. I'm happy with where this is now; I'll leave the final call to @mhsmith in case I've missed something he's concerned about.

@mhsmith
Copy link
Member

mhsmith commented Nov 27, 2024

  • android/src/toga_android/widgets/label.py was previously 88 columns and has been reduced to 80.

There's only 1 change in this file, and it's because the first line is 89 chars. The new flow ends up with the second line being 88 chars. Have I misunderstood what you're referring to?

Sorry, you're right – I must have lost the indentation when I copied the line into an editor to measure it.

  • android/src/toga_android/libs/events.py was previously 95 columns and has been reduced to 88.

Agreed.... but that's what we want, right?

Yes, I was just using it as a comparison.

@freakboy3742 freakboy3742 requested a review from mhsmith November 27, 2024 22:14
@freakboy3742 freakboy3742 requested a review from mhsmith November 28, 2024 21:58
@mhsmith mhsmith merged commit 7e0c402 into beeware:main Nov 28, 2024
40 checks passed
@freakboy3742 freakboy3742 mentioned this pull request Nov 29, 2024
4 tasks
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

Successfully merging this pull request may close these issues.

Flake8 line limit is inconsistent with Black
4 participants