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

Fix inconsistency of line length between flake8 and black #1583

Closed

Conversation

jcdrubay
Copy link

No description provided.

@jcdrubay
Copy link
Author

That was a fast approval :) Thanks @bealdav

@simahawk
Copy link
Contributor

@sbidoul it seems this is present in all repos: do we need a global update?

@sbidoul
Copy link
Member

sbidoul commented Apr 20, 2020

No, the current version (80, ignore E501, enable B950) is correct.
See https://github.com/psf/black#line-length for more details.

@jcdrubay do you experience specific issues with the current setup?

@simahawk
Copy link
Contributor

@sbidoul but what's the deal of keeping it like this? It can be confusing. If changing it is harmless then I'd sync those numbers. 🤔

@sbidoul
Copy link
Member

sbidoul commented Apr 20, 2020

@simahawk I can't explain better than the Black doc does.

Also, regarding these linter files, when they are deployed on a branch, If it ain't broke don't fix it, to avoid unnecessary noise :) Improvements can be discussed in OCA/maintainer-quality-tools to prepare for the next version.

[updated] OCA/maintainer-quality-tools, not OCA/maitnainer-tools

@simahawk
Copy link
Contributor

@sbidoul for me is fine, what could help is a simple comment on top of the file. @jcdrubay could you open an issue on https://github.com/OCA/maintainer-tools ?

@jcdrubay
Copy link
Author

@sbidoul Yes I am facing an issue but on a non OCA repository for a piece of code which is:

  • split on several lines with each line less than 80 characters before running pre-commit
  • re-formatted by black into a single line of more than 80 characters.
  • then I get a pre-commit exit 1 due to flake8

Example:

Before pre-commit,

                {
                    "time_log_type_id":
                        training_task.program_id.time_log_type_id.id,
                }

After pre-commit, the line is 85 characters long:

                {
                    "time_log_type_id": training_task.program_id.time_log_type_id.id,
                }

@jcdrubay
Copy link
Author

Closed in favor of: OCA/maintainer-tools#448

@jcdrubay jcdrubay closed this Apr 20, 2020
@sbidoul
Copy link
Member

sbidoul commented Apr 20, 2020

@jcdrubay sorry, I meant OCA/maintainer-quality-tools, that's where the sample files are.

For you specific case, can you check if you have the flake8-bugbear pluging. It's the one that allows occasional increased line lenght:

https://github.com/OCA/maintainer-quality-tools/blob/ce728c28d14afc983c0b58081cd92243c0f9085e/sample_files/pre-commit-13.0/.pre-commit-config.yaml#L61

@jcdrubay
Copy link
Author

@sbidoul

Thanks for the pointers.

Issue has been created on maintainers-quality-tools and closed on maintainer-tools.

Even with the flake8-bugbear plugin, I still get some issues.
Seems to be due to this: psf/black#1161

I still believe that the issue is valid for consistency, but at a much lower priority.

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

Successfully merging this pull request may close these issues.

None yet

4 participants