refactor: test organization and CI improvements#6
Merged
Conversation
- Add default excludes to pyproject.toml: - **/.* - **/__pycache__ - **/node_modules - **/.venv, **/venv - Exclude unnecessary files from Pylance analysis
- Organize tests into subdirectories by type: - tests/smoke/ - Basic sanity checks (imports, instantiation) - tests/unit/ - Individual method tests in isolation - tests/integration/ - Full lifecycle and interaction tests - Delete old test files from tests/ root - Add __init__.py files to each test subdirectory
- Run tests on push to main branch - Run tests on pull requests to main - Uses Poetry for dependency management - Runs smoke tests and unit tests separately
- post-edit: Run ruff format on edited Python files - pre-commit: Run smoke tests before committing - pre-push: Run ruff check before pushing - Add scripts/install-hooks.sh to install these hooks for other developers - Fix smoke tests to match existing module structure - Update ruff configuration to use new lint.* format
- Remove unused imports (CredentialError, CredentialStorage) - Fix f-strings without placeholders - Sort imports - Fix callable check (use callable() instead of hasattr(x, '__call__')) - Remove trailing whitespace This fixes 9 auto-fixable ruff issues. 61 issues remain (mostly E501 line length).
- Set all text files to use LF line endings - Explicitly declare Python, YAML, TOML, JSON, Markdown, shell scripts as LF - Keep Windows batch files as CRLF
This commit addresses all ruff linting issues, organized by fix difficulty: Easy fixes (16 issues): - F401 (5): Remove unused imports in smoke tests - E402 (1): Add noqa comment for intentional late import - ARG001 (3): Prefix unused fixture parameters with _ - SIM105 (6): Use contextlib.suppress() instead of try/except/pass Medium fixes (3 issues): - B011 (1): Replace assert False with raise AssertionError() - B904 (2): Add 'from' clause to raise statements in except blocks Hard fixes (54 issues): - E501 (39): Fix line length issues (>88 chars) - Break long typer.Option help text across multiple lines - Break long string literals in console.print() calls - Break long API calls across multiple lines - Break long function parameters across multiple lines - Reformat long docstring lines - Fix os.open() calls with long flags Additional improvements: - Add .gitattributes to standardize line endings to LF - Add contextlib imports where needed for contextlib.suppress() All smoke and unit tests still pass after these changes.
- Add comprehensive development guide covering testing, hooks, and workflow - Document Claude Code hooks (post-edit, pre-commit, pre-push) - Document test structure (smoke, integration, unit) - Update README with link to development guide - Refactor unit tests for Config class Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fixes test failures caused by Parameter.make_metavar() signature change in Click 8.3.x. Typer 0.25.1+ supports the new Click API. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove unused pathlib.Path import - Remove unused ConfigError import Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Patch campus_cli.auth.common.credentials instead of the non-existent campus_cli.auth.status.credentials. The status command is in login.py and imports credentials via common.get_token_status(). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Update install-hooks scripts to use .\.venv\Scripts\poetry.exe instead of relying on PATH. This fixes "poetry: command not found" errors when git runs hooks in a different environment. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Test organization
CI/CD improvements
Code quality
🤖 Generated with Claude Code