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

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #19

Merged
merged 5 commits into from
Nov 25, 2024

Conversation

yarikoptic
Copy link
Contributor

@yarikoptic yarikoptic commented Nov 21, 2024

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

  • remove TEMP commit and possible github workflow if pre-commit picks up the typo somewhere inCI

…agically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
Copy link
Collaborator

@marshallmcdonnell marshallmcdonnell left a 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.

README.md Outdated Show resolved Hide resolved
@Lance-Drane
Copy link
Collaborator

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 (pdm add --dev -G lint codespell) and make sure it's reflected in the lockfile.

@@ -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: ...
Copy link
Collaborator

@Lance-Drane Lance-Drane Nov 21, 2024

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.

Copy link
Contributor Author

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 :-(

@Lance-Drane
Copy link
Collaborator

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:

2024-11-21_12-17

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 ^^^
@yarikoptic yarikoptic marked this pull request as ready for review November 22, 2024 22:43
@Lance-Drane
Copy link
Collaborator

This LGTM, I think the pipeline failing is not related to this MR so I'll go ahead and merge. Thank you!

@Lance-Drane Lance-Drane merged commit 08a414c into INTERSECT-SDK:main Nov 25, 2024
17 of 18 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