Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes type checking issues in the tests directory by adding type annotations and updating configuration to enable type checking for test files.
- Adds type annotations to CLI functions and test utilities
- Includes type ignore comments for dynamic attribute assignments
- Removes exclusion of tests directory from type checking configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_hap_workdir.py | Adds null check assertion for type safety |
| tests/test_cli_utils.py | New test file for CLI utilities with proper typing |
| tests/conftest.py | Adds type ignore comment for dynamic attribute assignment |
| pyproject.toml | Removes tests directory from type checking exclusion and reorders dependencies |
| hapless/utils.py | Adds new utility functions with proper imports |
| hapless/main.py | Updates imports and uses new utility function |
| hapless/cli.py | Adds type annotations to function parameters |
| README.md | Updates badges to replace black formatter badge with ty type checker |
| DEVELOP.md | Adds documentation for linting and type checking commands |
| .github/workflows/tests.yml | Removes conditional type checking for tests directory |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| hapless_test = Hapless(hapless_dir=Path(path)) | ||
| with patch("hapless.cli.hapless", hapless_test) as hapless_mock: | ||
| cli_runner.hapless = hapless_mock | ||
| cli_runner.hapless = hapless_mock # ty: ignore[unresolved-attribute] |
There was a problem hiding this comment.
The type ignore comment contains a typo. It should be type: ignore instead of ty: ignore.
Suggested change
| cli_runner.hapless = hapless_mock # ty: ignore[unresolved-attribute] | |
| cli_runner.hapless = hapless_mock # type: ignore[unresolved-attribute] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
testsdirectory