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

black and ruff are fighting with each other #2597

Closed
nforro opened this issue Oct 23, 2024 · 0 comments · Fixed by #2599
Closed

black and ruff are fighting with each other #2597

nforro opened this issue Oct 23, 2024 · 0 comments · Fixed by #2599
Labels
complexity/single-task Regular task, should be done within days. kind/internal Doesn't affect users directly, may be e.g. infrastructure, DB related.

Comments

@nforro
Copy link
Member

nforro commented Oct 23, 2024

black has a default line length limit of 88 characters, but in case it's not possible to achieve it, it seems to give up and try to minimize the number of lines such chunk of code spans over. But ruff with its line length limit set to 100 doesn't accept that and formats the chunk so it fits, or at least complains about line being too long.

Here is the code:

black variant:

                    existing_models = BodhiUpdateTargetModel.get_all_successful_or_in_progress_by_nvrs(
                            target_model.koji_nvrs,
                    )

ruff variant:

                    existing_models = (
                        BodhiUpdateTargetModel.get_all_successful_or_in_progress_by_nvrs(
                            target_model.koji_nvrs,
                        )
                    )

See also here: #2596

@lachmanfrantisek lachmanfrantisek added complexity/single-task Regular task, should be done within days. kind/internal Doesn't affect users directly, may be e.g. infrastructure, DB related. labels Oct 24, 2024
mfocko added a commit to mfocko/packit-service that referenced this issue Oct 24, 2024
* Also run ruff before formatting, still doesn't resolve deps though

Fixes packit#2597

Signed-off-by: Matej Focko <[email protected]>
mfocko added a commit to mfocko/packit-service that referenced this issue Oct 24, 2024
* Enable ruff-format
* Disable black

Fixes packit#2597

Signed-off-by: Matej Focko <[email protected]>
mfocko added a commit to mfocko/packit-service that referenced this issue Oct 24, 2024
* Enable ruff-format
* Disable black

Fixes packit#2597

Signed-off-by: Matej Focko <[email protected]>
softwarefactory-project-zuul bot added a commit that referenced this issue Oct 24, 2024
ci(ruff): enable ruff-format

Enable ruff-format
Disable black

Fixes #2597

Reviewed-by: Laura Barcziová
Reviewed-by: Nikola Forró
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity/single-task Regular task, should be done within days. kind/internal Doesn't affect users directly, may be e.g. infrastructure, DB related.
Projects
Archived in project
2 participants