@@ -44,7 +44,7 @@ The audit identified several limitations in the current CLI tools:
44
44
""" Add detect command parser to the subparsers.
45
45
46
46
Parameters
47
- ----------
47
+ ----
48
48
subparsers : argparse._SubParsersAction
49
49
Subparsers object to add command to
50
50
"""
@@ -153,14 +153,14 @@ The audit identified several limitations in the current CLI tools:
153
153
""" Detect repositories in a directory.
154
154
155
155
Parameters
156
- ----------
156
+ ----
157
157
args : argparse.Namespace
158
158
Parsed command arguments
159
159
ctx : CliContext
160
160
CLI context
161
161
162
162
Returns
163
- -------
163
+ ----
164
164
int
165
165
Exit code
166
166
"""
@@ -224,6 +224,7 @@ The audit identified several limitations in the current CLI tools:
224
224
import traceback
225
225
traceback.print_exc()
226
226
return 1
227
+ ```
227
228
228
229
4 . ** Implementation Details** :
229
230
``` python
@@ -243,7 +244,7 @@ The audit identified several limitations in the current CLI tools:
243
244
""" Detect repositories in a directory.
244
245
245
246
Parameters
246
- ----------
247
+ ----
247
248
directory : Path
248
249
Directory to scan for repositories
249
250
recursive : bool
@@ -264,7 +265,7 @@ The audit identified several limitations in the current CLI tools:
264
265
Detect and include remote configurations
265
266
266
267
Returns
267
- -------
268
+ ----
268
269
list[Repository]
269
270
List of detected Repository objects
270
271
"""
@@ -307,7 +308,7 @@ The audit identified several limitations in the current CLI tools:
307
308
""" Add lock command parser to the subparsers.
308
309
309
310
Parameters
310
- ----------
311
+ ----
311
312
subparsers : argparse._SubParsersAction
312
313
Subparsers object to add command to
313
314
"""
@@ -355,14 +356,14 @@ The audit identified several limitations in the current CLI tools:
355
356
""" Create a lock file with specific repository versions.
356
357
357
358
Parameters
358
- ----------
359
+ ----
359
360
args : argparse.Namespace
360
361
Parsed command arguments
361
362
ctx : CliContext
362
363
CLI context
363
364
364
365
Returns
365
- -------
366
+ ----
366
367
int
367
368
Exit code
368
369
"""
@@ -406,12 +407,15 @@ The audit identified several limitations in the current CLI tools:
406
407
4 . ** Lock File Model** :
407
408
``` python
408
409
# src/vcspull/config/models.py
410
+ import typing as t
411
+ from pathlib import Path
412
+ from pydantic import BaseModel, Field, ConfigDict
409
413
410
414
class LockedRepository (BaseModel ):
411
415
""" Repository with locked version information.
412
416
413
417
Parameters
414
- ----------
418
+ ----
415
419
name : str
416
420
Name of the repository
417
421
path : Path
@@ -437,7 +441,7 @@ The audit identified several limitations in the current CLI tools:
437
441
""" Lock file for repository versions.
438
442
439
443
Parameters
440
- ----------
444
+ ----
441
445
repositories : list[LockedRepository]
442
446
List of locked repositories
443
447
"""
@@ -451,7 +455,7 @@ The audit identified several limitations in the current CLI tools:
451
455
""" Save lock file to disk.
452
456
453
457
Parameters
454
- ----------
458
+ ----
455
459
path : Path
456
460
Path to save lock file
457
461
"""
@@ -472,17 +476,17 @@ The audit identified several limitations in the current CLI tools:
472
476
""" Load lock file from disk.
473
477
474
478
Parameters
475
- ----------
479
+ ----
476
480
path : Path
477
481
Path to lock file
478
482
479
483
Returns
480
- -------
484
+ ----
481
485
LockFile
482
486
Loaded lock file
483
487
484
488
Raises
485
- ------
489
+ ----
486
490
FileNotFoundError
487
491
If lock file does not exist
488
492
"""
@@ -527,7 +531,7 @@ The audit identified several limitations in the current CLI tools:
527
531
""" Add apply-lock command parser to the subparsers.
528
532
529
533
Parameters
530
- ----------
534
+ ----
531
535
subparsers : argparse._SubParsersAction
532
536
Subparsers object to add command to
533
537
"""
@@ -575,14 +579,14 @@ The audit identified several limitations in the current CLI tools:
575
579
""" Apply lock file to ensure repositories are at specific versions.
576
580
577
581
Parameters
578
- ----------
582
+ ----
579
583
args : argparse.Namespace
580
584
Parsed command arguments
581
585
ctx : CliContext
582
586
CLI context
583
587
584
588
Returns
585
- -------
589
+ ----
586
590
int
587
591
Exit code
588
592
"""
@@ -656,12 +660,12 @@ def main(argv: t.Optional[list[str]] = None) -> int:
656
660
""" CLI entry point.
657
661
658
662
Parameters
659
- ----------
663
+ ----
660
664
argv : Optional[list[str]]
661
665
Command line arguments, defaults to sys.argv[1:] if not provided
662
666
663
667
Returns
664
- -------
668
+ ----
665
669
int
666
670
Exit code
667
671
"""
@@ -733,7 +737,7 @@ if __name__ == "__main__":
733
737
""" Register shell completion for the parser.
734
738
735
739
Parameters
736
- ----------
740
+ ----
737
741
parser : argparse.ArgumentParser
738
742
Argument parser to register completion for
739
743
"""
0 commit comments