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

update .pre-commit-config to match linting used by CI #1906

Merged
merged 12 commits into from
Oct 27, 2023

Conversation

Coniferish
Copy link
Collaborator

Closes #1905
.pre-commit-config.yaml does not match pyproject.toml, which causes unnecessary/undesirable formatting changes. These changes are not required by CI, so they should not have to be made.

To Reproduce
Install pre-commit configuration as described here. Make a commit and something like the following will be logged:

check for added large files..............................................Passed
check toml...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check xml............................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
mixed line ending........................................................Passed
black....................................................................Passed
ruff.....................................................................Failed
- hook id: ruff
- files were modified by this hook

@Coniferish Coniferish requested review from scanny and qued October 26, 2023 21:51
Copy link
Collaborator

@scanny scanny left a comment

Choose a reason for hiding this comment

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

LGTM :)

@Coniferish
Copy link
Collaborator Author

@scanny Though the initial trailing commas aren't registering as an issue, I am getting the following commas added (these are new):

@@ -764,8 +764,8 @@ class Describe_TextSectionBuilder:
         builder.add_element(
             Text(
                 "Lorem ipsum dolor sit amet consectetur adipiscing elit. In rhoncus ipsum sed"
-                "lectus porta volutpat."
-            )
+                "lectus porta volutpat.",
+            ),
         )
 
         section = next(builder.flush())

@scanny
Copy link
Collaborator

scanny commented Oct 27, 2023

@Coniferish hmm, that's odd, let me take a look. Are those being added locally by the pre-commit hook?

Those aren't by themselves problematic because they don't increase the line count, but they don't happen on my machine and CI doesn't complain about it. Can you tell if those are added by ruff or perhaps by Black?

@scanny
Copy link
Collaborator

scanny commented Oct 27, 2023

That looks like flake-commas: C812. which should be ignored now. If you take those out and save, do they come back on commit locally? Could have been left-overs I'm thinking.

@qued
Copy link
Contributor

qued commented Oct 27, 2023

Could you also add the ignores to the make tidy target in Makefile?

@Coniferish
Copy link
Collaborator Author

Coniferish commented Oct 27, 2023

Could have been left-overs I'm thinking.

@scanny Yah, looks like they were. My mistake.

@Coniferish
Copy link
Collaborator Author

@qued Please look at the changes I pushed--I added a couple of things the to make commands that seem like they were also left out of updates to other pyproject.toml ("E,F")

@badGarnet badGarnet merged commit 670687b into main Oct 27, 2023
@badGarnet badGarnet deleted the jj/1905-pre-commit-hook branch October 27, 2023 18:24
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.

bug/ pre-commit hook out of date with pyproject.toml
4 participants