-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add codespell support (config, workflow to detect/not fix) and make it fix few typos #19
Conversation
…agically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, LGTM!
I have one small change request that just looks like an accident but overall, thanks for the contribution!
Pinging @Lance-Drane since I am happy to approve but would like his review of CI + pre-commit before merge.
14971ab
to
33da9ff
Compare
Thank you for the contribution! I think that this will be a useful addition, particularly since it's catching several documentation and Exception spelling errors. (It's pretty funny that I made the same spelling error in both an Exception and a test checking the Exception message.) The only thing I think is necessary would be to get rid of the test commit, I'm happy to approve otherwise. I don't mind doing this myself if you're not familiar with PDM, but I'd like to add it as a PDM development dependency under the "lint" group ( |
@@ -132,7 +132,7 @@ class PydanticUnparsableInner: | |||
three: str | |||
|
|||
@intersect_message() | |||
def cant_parse_annotation(self, unparseable: PydanticUnparsableInner) -> None: ... | |||
def cant_parse_annotation(self, unparsable: PydanticUnparsableInner) -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the assertion statement of this test on line 140, we'll need to change parameter 'unparseable'
to parameter 'unparsable'
to make sure it passes the test. I think this is the only reason the tests are failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha -- thanks for catching. I didn't know about this nuance! Apparently codespell, while determining words, includes '
as part of the word.
Proposed
and now digging deeper there :-(
It looks like the CI pipeline works, BTW: https://github.com/INTERSECT-SDK/python-sdk/actions/runs/11957237005/job/33336619928?pr=19 In case it isn't visible: |
codespell from codespell-project/codespell#3588 === Do not change lines below === { "chain": [], "cmd": "codespell -w ./tests/unit/test_schema_invalids.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^
130f653
to
5d44c81
Compare
This LGTM, I think the pipeline failing is not related to this MR so I'll go ahead and merge. Thank you! |
More about codespell: https://github.com/codespell-project/codespell .
I personally introduced it to dozens if not hundreds of projects already and so far only positive feedback.
CI workflow has 'permissions' set only to 'read' so also should be safe.
TODOs
and possible github workflow if pre-commit picks up the typo somewhere inCI