1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! Validate AGPM project configuration and dependencies.
//!
//! This module provides the `validate` command which performs comprehensive
//! validation of a AGPM project's manifest file, dependencies, sources, and
//! overall configuration. The command can check various aspects of the project
//! setup and report issues or warnings.
//!
//! # Features
//!
//! - **Manifest Validation**: Checks `agpm.toml` syntax and structure
//! - **Dependency Resolution**: Verifies all dependencies can be resolved
//! - **Source Accessibility**: Tests if source repositories are reachable
//! - **Path Validation**: Checks if local file dependencies exist
//! - **Lockfile Consistency**: Compares manifest and lockfile for consistency
//! - **Multiple Output Formats**: Text and JSON output formats
//! - **Strict Mode**: Treats warnings as errors for CI environments
//!
//! # Examples
//!
//! Basic validation:
//! ```bash
//! agpm validate
//! ```
//!
//! Comprehensive validation with all checks:
//! ```bash
//! agpm validate --resolve --sources --paths --check-lock
//! ```
//!
//! JSON output for automation:
//! ```bash
//! agpm validate --format json
//! ```
//!
//! Strict mode for CI:
//! ```bash
//! agpm validate --strict --quiet
//! ```
//!
//! Validate specific manifest file:
//! ```bash
//! agpm validate ./projects/my-project/agpm.toml
//! ```
//!
//! # Validation Levels
//!
//! ## Basic Validation (Default)
//! - Manifest file syntax and structure
//! - Required field presence
//! - Basic consistency checks
//!
//! ## Extended Validation (Flags Required)
//! - `--resolve`: Dependency resolution verification
//! - `--sources`: Source repository accessibility
//! - `--paths`: Local file path existence
//! - `--check-lock`: Lockfile consistency with manifest
//!
//! # Output Formats
//!
//! ## Text Format (Default)
//! ```text
//! ✓ Valid agpm.toml
//! ✓ Dependencies resolvable
//! ⚠ Warning: No dependencies defined
//! ```
//!
//! ## JSON Format
//! ```json
//! {
//! "valid": true,
//! "manifest_valid": true,
//! "dependencies_resolvable": true,
//! "sources_accessible": false,
//! "errors": [],
//! "warnings": ["No dependencies defined"]
//! }
//! ```
//!
//! # Error Categories
//!
//! - **Syntax Errors**: Invalid TOML format or structure
//! - **Semantic Errors**: Missing required fields, invalid references
//! - **Resolution Errors**: Dependencies cannot be found or resolved
//! - **Network Errors**: Sources are not accessible
//! - **File System Errors**: Local paths do not exist
//! - **Consistency Errors**: Manifest and lockfile are out of sync
// Re-export public API
pub use ;
pub use ValidationResults;