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

[pre-commit.ci] pre-commit autoupdate #816

Merged
merged 7 commits into from
May 6, 2024
Merged

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Apr 8, 2024

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/psf/black: 24.3.0 → 24.4.0](psf/black@24.3.0...24.4.0)
@chrisjonesBSU
Copy link
Contributor

chrisjonesBSU commented Apr 29, 2024

I'm stumped with this one.

- hook id: pydocstyle
- exit code: 1
- 
WARNING: Error in file gmso/utils/ff_utils.py: Unexpected token tk.FSTRING_MIDDLE (class), expected 1

It looks like pydocstyle has been deprecated and archived. I wonder if something broke between pydocstyle and the latest version of pre-commit? I'm not that familiar with the internal working of pre-commit, but it seems like we might need to replace the pydocstyle hook at some point. ruff is an alternative they give.

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
- [github.com/psf/black: 24.3.0 → 24.4.2](psf/black@24.3.0...24.4.2)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 925642d to 7ffeb5a Compare April 29, 2024 23:28
@chrisjonesBSU
Copy link
Contributor

chrisjonesBSU commented May 1, 2024

I dug around a little bit, I think the error isn't a pre-commit error, but related to the tokenize and token packages in python's built in libraries. If I run pre-commit locally on ff_utils.py with python 3.12, I get this error, if I downgrade to python 3.11, this error doesn't occur and all of the pre-commit checks pass.

@CalCraven
Copy link
Contributor

I dug around a little bit, I think the error isn't a pre-commit error, but related to the tokenize and token packages in python's built in libraries. If I run pre-commit locally on ff_utils.py with python 3.12, I get this error, if I downgrade to python 3.11, this error doesn't occur and all of the pre-commit checks pass.

I can second this, I ran it on 3.11 and didn't get the error.

To add to the reading, it looks like this may have some info about FSTRING_MIDDLE.

It may actually be an issue with pre-commit (pydocstyle) being unable to parse the updated lexing of f-strings.

Therefore, I think we may be forced to replace pydocstyle for ruff, as mentioned above by @chrisjonesBSU. A second solution would be to not check this file in the pre-commit-config file.

@CalCraven
Copy link
Contributor

https://github.com/astral-sh/ruff-pre-commit This looks like what we want

@CalCraven
Copy link
Contributor

Tried to test this in #819, so we'll see if the linting works.

@daico007 daico007 merged commit 6f0631f into main May 6, 2024
12 checks passed
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.

3 participants