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

Enable ruff format skip-magic-trailing-comma #2975

Merged
merged 6 commits into from
Oct 7, 2024
Merged

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented May 21, 2024

Changes

This enables ruff format skip-magic-trailing-comma. This prevents formatting only changes in PRs when an argument is added and later removed.

The downside is that in some cases it might be more readable to have each argument on a single line, but in my opinion it more important to have consistent formatting and prevent formatting only changes in PRs.


Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@dekkers dekkers requested a review from a team as a code owner May 21, 2024 10:02
@dekkers dekkers self-assigned this May 21, 2024
Donnype
Donnype previously approved these changes May 21, 2024
Copy link
Contributor

@Donnype Donnype left a comment

Choose a reason for hiding this comment

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

At first I thought this PR did the exact opposite, but now I realize I am 200% for this change. I want to read the code naturally and see a lot of context on my screen, and not
keep
having
to
scroll
down
after
every
three
function
calls.

@dekkers
Copy link
Contributor Author

dekkers commented Oct 3, 2024

We currently don't have a lot of big PRs open, so merging this now shouldn't generate a lot of merge conflicts.

I have looked into alternatives, but enabling this is the only way to make sure that there is one way to format the same code instead of two. So while in some cases the code might be a little bit more readable when not collapsed into a single line, I think having only one way to format code and less noise in PRs is more important.

The only thing I did was add the option to pyproject.toml and run pre-commit so there should only be formatting changes in this PR.

@underdarknl
Copy link
Contributor

I agree, and I was waiting for a moment like this to pull this PR back to the front. Lets see if this is the moment.

Donnype
Donnype previously approved these changes Oct 4, 2024
Copy link

sonarcloud bot commented Oct 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
11 Security Hotspots
68.7% Coverage on New Code (required ≥ 80%)
3.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@underdarknl underdarknl merged commit 2a89161 into main Oct 7, 2024
53 of 54 checks passed
@underdarknl underdarknl deleted the magic-trailing-comma branch October 7, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants