-
Notifications
You must be signed in to change notification settings - Fork 14
New commands: add
and add-from-fs
#465
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis pull request introduces two new CLI subcommands, File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
add
and add-from-fs
add
and add-from-fs
a36fbef
to
69a222e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #465 +/- ##
==========================================
- Coverage 78.93% 72.52% -6.42%
==========================================
Files 8 10 +2
Lines 413 626 +213
Branches 85 133 +48
==========================================
+ Hits 326 454 +128
- Misses 52 126 +74
- Partials 35 46 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d37cb7e
to
628830e
Compare
e85482d
to
e26036d
Compare
Make config parameter in sync function explicitly optional in type signature to match actual behavior. This improves type checking without changing functionality.
- Fix sync() function call to pass pathlib.Path for config parameter - Add save_config_yaml to helpers and fix imports - Improve test teardown to use shutil.rmtree - Add missing pathlib import in CLI __init__.py - Set logging level in tests for proper log capture
The sync() function requires config as a parameter even when None. Update the kwargs filtering to always include config in the allowed parameters list.
- Fix line length issues (E501) in CLI modules - Replace open() with Path.open() (PTH123) - Remove redundant exception objects in logging.exception() calls (TRY401) - Break long strings across multiple lines for better readability - All ruff and mypy checks now pass for the new CLI commands
- Add save_config_yaml to vcspull.config module using ConfigReader._dump - Remove duplicate implementations from cli/add.py and cli/add_from_fs.py - Update imports to use the centralized function - Remove duplicate from test helpers - Follows DRY principle and provides consistent YAML formatting
- Replace complex repo_name_or_url parsing with explicit name and url args - Remove 150+ lines of confusing comments and logic - Add clear --path and --dir options for specifying location - Make command usage intuitive: vcspull add <name> <url> - Reduce add_repo function from 270 to 163 lines - Improve help text and parameter documentation
… patterns why: Ensure consistency with project patterns and improve code maintainability. what: - Updated module and function docstrings to match NumPy style - Cleaned up imports and removed unnecessary comments - Fixed error handling to match sync.py patterns - Fixed type annotations for mypy compliance - Fixed non-recursive scanning bug in add_from_fs.py - Removed unused helper functions in tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…notation why: Fix mypy error for variable redefinition on line 201. what: - Remove redundant type annotation for determined_base_key in non-recursive branch - Variable was already declared with type annotation in recursive branch 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ositories why: Users need visibility into which repositories already exist in configuration and where they are located. what: - Show count and detailed list of existing repositories when found - Display repository name, URL, config path, and file location for each existing repo - Simplify logic by consolidating duplicate repository checking code - Improve user experience with more informative output 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
… existing repo reporting why: Ensure the enhanced output functionality works correctly across different scenarios. what: - Update existing test to verify new detailed output format - Add test for multiple existing repositories with detailed listing - Add test for mixed scenario with both existing and new repositories - Verify count, individual repo details, and final status messages - Test output includes repo name, URL, config path, and file location 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ommands why: CLI add/add-from-fs commands should have clean output like print() while preserving debug output for VCS operations. what: - Add SimpleLogFormatter that outputs only the message without extra formatting - Configure specific loggers for vcspull.cli.add and vcspull.cli.add_from_fs to use simple formatter - Keep DebugLogFormatter for vcspull core operations and sync commands - Prevent logger propagation to avoid duplicate output - Maintain detailed VCS operation logging for sync functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ilities why: Ensure proper testing coverage for all logging formatters and setup functionality what: - Add test_log.py with comprehensive test coverage for all log components - Test LogFormatter, DebugLogFormatter, SimpleLogFormatter, RepoLogFormatter classes - Test RepoFilter functionality and setup_logger behavior - Test integration scenarios with actual loggers - Follow vcspull testing patterns with NamedTuple parametrized tests - Include proper pytest fixtures for logger cleanup 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…rting why: Follow best practices for exception logging and provide better debugging info what: - Replace log.error with log.exception in exception handlers - Maintain existing debug traceback functionality - Apply to both add.py and add_from_fs.py modules 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
why: Ensure code passes linting and follows project formatting standards what: - Fix line length violations by splitting long strings - Improve code readability with proper line breaks - Use dict() constructor for cleaner code - Remove unused loop variables with underscore prefix 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
… clean output why: Ensure CLI sync command provides clean user-facing output like print() what: - Extend SimpleLogFormatter to vcspull.cli.sync logger - Consolidate CLI logger setup with DRY loop pattern - Maintain clean output for all user-facing CLI commands 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…e stderr why: SimpleLogFormatter outputs to stderr via StreamHandler, but test only captured stdout what: - Update output capture to include both stdout and stderr - Use iterable unpacking for cleaner code style - Ensure all CLI log messages are properly captured in tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ync logger why: Ensure CLI sync logger is properly configured with SimpleLogFormatter what: - Add test_setup_logger_creates_cli_sync_logger test case - Update logger cleanup fixture to include sync logger - Update all setup_logger tests to clear sync logger handlers - Verify sync logger uses SimpleLogFormatter for clean output 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Fixes:
add-from-fs
#25Summary by Sourcery
Add new CLI commands
add
andadd-from-fs
to vcspull for managing repository configurationNew Features:
add
command to add a single repository to vcspull configurationadd-from-fs
command to scan and add multiple git repositories from a directoryEnhancements: