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 pyright sanity check #42

Merged
merged 13 commits into from
Nov 20, 2024
Merged

Add pyright sanity check #42

merged 13 commits into from
Nov 20, 2024

Conversation

samdoran
Copy link
Contributor

@samdoran samdoran commented Nov 19, 2024

Fix a few bugs/errors discovered by the type checker.

Add type narrowing hints in the config classes to get accurate attribute checking.

Change default values that can be a str or Path object to Path objects.

Add a pre-commit check for easy local testing but use a GitHub action to run type checking in CI. Pre-commit CI doses not allow network access, which prevents installation of pyright.

Depends on #44.

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
command_line_assistant/__main__.py 0.00% <ø> (ø)
command_line_assistant/config.py 72.30% <100.00%> (ø)
command_line_assistant/history.py 90.90% <100.00%> (ø)

🚨 Try these New Features:

@samdoran samdoran force-pushed the add-pyright-to-precommit branch 3 times, most recently from a3c3f3f to bf79396 Compare November 19, 2024 23:01
@samdoran
Copy link
Contributor Author

Evidently network access is not allowed in pre-commit ci. 🤦

pre-commit-ci/issues#55

@samdoran samdoran force-pushed the add-pyright-to-precommit branch 2 times, most recently from b714626 to 9ce4b24 Compare November 20, 2024 04:59
@samdoran samdoran changed the title Add pyright to precommit checks Add pyright sanity check Nov 20, 2024
@samdoran samdoran force-pushed the add-pyright-to-precommit branch 5 times, most recently from e2bdf1b to abc5354 Compare November 20, 2024 05:21
@samdoran
Copy link
Contributor Author

There ended up being a lot of changes to get this working. I can break them into separate PRs, especially things like reducing the duplicate runs for of unit tests.

@samdoran
Copy link
Contributor Author

I added another pre-commit check to show the diff when ruff lint fails since it's helpful to see the diff when there are failures. It'd be nice if ruff could show the diff and make changes, but --diff only displays the diff.

@samdoran samdoran marked this pull request as draft November 20, 2024 14:02
@samdoran samdoran force-pushed the add-pyright-to-precommit branch from abc5354 to 0455bff Compare November 20, 2024 20:55
@samdoran
Copy link
Contributor Author

This is expected to fail until #44 is merged.

@samdoran samdoran force-pushed the add-pyright-to-precommit branch from 0455bff to 04415ba Compare November 20, 2024 21:10
@samdoran samdoran marked this pull request as ready for review November 20, 2024 21:10
Copy link
Member

@major major left a comment

Choose a reason for hiding this comment

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

Looks good, let's roll.

@major major merged commit 557c7a8 into main Nov 20, 2024
13 checks passed
@major major deleted the add-pyright-to-precommit branch November 20, 2024 21:20
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.

2 participants