-
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
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 Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@ ## master #465 +/- ## ========================================== - Coverage 78.93% 77.30% -1.63% ========================================== Files 8 10 +2 Lines 413 639 +226 Branches 85 137 +52 ========================================== + Hits 326 494 +168 - Misses 52 94 +42 - Partials 35 51 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d37cb7e
to
628830e
Compare
e85482d
to
e26036d
Compare
740c98c
to
1045626
Compare
ca15fce
to
c68f1d5
Compare
c68f1d5
to
32bbbd8
Compare
1a6b722
to
40c47a6
Compare
40c47a6
to
1e1becb
Compare
0789254
to
8793a5d
Compare
why: Need consistent YAML writing functionality for new CLI commands what: - Add save_config_yaml function to centralize config file writing - Use ConfigReader._dump for consistent formatting refs: Foundation for add/add-from-fs commands
why: Users need a way to manually add individual repositories to config what: - Add command to add single repository by name and URL - Support custom base directory with --dir option - Support path inference with --path option - Check for duplicates and warn appropriately - Use verbose format {"repo": "url"} for new entries
...ition why: Users with many existing repos need efficient bulk import what: - Scan directories for git repositories - Extract origin URLs from git config - Support recursive scanning with -r/--recursive - Custom base directory key with --base-dir-key - Auto-confirm with -y/--yes - Show summary for large numbers of existing repos
why: Sync function needs to handle cases where config is not specified what: - Change sync function signature to accept optional config - Update CLI handler to properly pass config parameter
why: CLI commands need user-friendly output without log prefixes what: - Add SimpleLogFormatter class for message-only output - Configure CLI modules (add, add_from_fs, sync) to use simple formatter - Maintain debug formatter for core vcspull logger - Set propagate=False to prevent duplicate logging
why: Ensure add command functionality is properly tested what: - Test simple repository addition - Test custom base directory handling - Test duplicate detection - Test adding to existing config
...canner why: Ensure add-from-fs functionality works correctly what: - Test git origin URL extraction - Test single and multiple repo discovery - Test recursive and non-recursive scanning - Test user confirmation flow - Test existing repo handling - Test output formatting for many repos
why: Ensure logging infrastructure works as expected what: - Test SimpleLogFormatter output - Test RepoLogFormatter functionality - Test DebugLogFormatter with various log levels - Test logger configuration and propagation
why: Some CLI output goes to stderr and was being missed what: - Capture both stdout and stderr in test_sync_cli_filter_non_existent - Ensures complete output validation in test
why: Tests didn't follow established vcspull testing patterns what: - Convert to parameterized tests using AddRepoFixture(NamedTuple) - Test through CLI entry point instead of direct function calls - Add clear_logging_handlers fixture to prevent stream closure issues - Remove caplog.set_level() calls that were causing handler conflicts - Maintain full test coverage with improved organization refs: #tests
...entions why: Tests didn't follow established vcspull testing patterns and had logging issues what: - Convert to parameterized tests using AddFromFsFixture(NamedTuple) - Test through CLI entry point for integration testing - Add helper functions setup_git_repo() and clone_repo() for test setup - Add clear_logging_handlers fixture to prevent stream closure issues - Remove caplog.set_level() calls that were causing handler conflicts - Improve test organization and maintain full coverage refs: #tests
...ception handler why: Match established error handling patterns in the codebase what: - Change raise to return in save_config_yaml exception handler - Maintains consistency with other modules' error handling approach
...se in exception handler why: Match established error handling patterns in the codebase what: - Change raise to return in save_config_yaml exception handler - Maintains consistency with other modules' error handling approach
why: Address ruff linting warnings to improve code quality and consistency what: - Move traceback imports to module level instead of conditional imports - Convert f-string logging to % formatting for better performance - Fix line length issues to meet 88 character limit - Maintain all functionality while improving code style All tests passing after changes.
872fa61
to
2b1e330
Compare
why: Follow imperative mood convention for docstrings (D401) what: - Change "Helper to set up" to "Set up" in setup_git_repo docstring - Change "Helper to clone" to "Clone" in clone_repo docstring refs: D401 ruff rule
why: Users need a way to standardize and clean up their vcspull configurations what: - Add format_config_file function to format vcspull configs - Implement normalize_repo_config to convert compact to verbose format - Convert url keys to repo keys for consistency - Sort directories and repositories alphabetically - Add --write flag requirement for actual file modification - Show detailed summary of changes when run without --write
why: Wire up the fmt command to the main CLI interface what: - Import fmt module and format_config_file function - Add fmt_parser to subparsers with help text - Add fmt handling in cli() function with config and write arguments - Update create_parser return tuple to include fmt_parser
why: Ensure fmt command works correctly with various config formats what: - Add TestNormalizeRepoConfig class for testing repo normalization - Add TestFormatConfig class for testing config formatting logic - Add TestFormatConfigFile class for testing file operations - Test compact to verbose format conversion - Test url to repo key conversion - Test directory and repository sorting - Test --write flag behavior and dry-run mode - Add clear_logging_handlers fixture to prevent test interference
Uh oh!
There was an error while loading. Please reload this page.
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: