Closed pre-commit-ci[bot] closed 2 months ago
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.
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 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.
https://github.com/astral-sh/ruff-pre-commit This looks like what we want
Tried to test this in #819, so we'll see if the linting works.
updates: