Index
Directory Structure Validator
A tool to validate directory structures against a JSON schema. Checks for required folders and files according to the specified configuration.
Features
-
Validates nested folder structures
-
Checks for required/optional files
-
Supports file extensions validation
-
Detailed error reporting
Example JSON structure
Significant typing
Usage:
# Cargo.toml
[]
= "0.2.4"
use ValidateDirTree;
let validate_structure = ValidateDirTree ;
let results = validate_structure.validate_structure;
println!;
Directory tree on my my_project_example
/ my_project_example
βββ trees field πΉ
β βββ mountain.html πΉ
β βββ mountain.js πΉ
β βββ mountain.css πΉ
β βββ main.js π· // no defined on JSON structure
β βββ sub_forest πΉ
β βββ file_optinal.html πΉ
β βββ file_optinal.js πΉ
β βββ file_optinal.css πΉ
β βββ file_optinal.lock π· // no defined on JSON structure
β βββ file_optinal.ts πΉ
βββ ocean π· // no defined on JSON structure
βββ pacific.html π· // only show message in parent folder
βββ pacific.js π· // only show message in parent folder
Sample Output Vec<AlertFileStructure>
List of errors
-
ResultValidationTypes:
- Error - > File "/trees field/main.js" is a ExtraFile because wasn't defined on JSON
- Error - > File "/trees field/sub_forest/file_sub_forest.js" is a MissingFile because was defined on JSON
- Error - > File "/trees field/sub_forest/file_sub_forest.css" is a MissingFile because was defined on JSON
- Error - > File "/trees field/sub_forest/file_sub_forest.html" is a MissingFile because was defined on JSON
- Error - > File "/trees field/sub_forest/file_optinal.lock" is a ExtraFile because wasn's defined on JSON
- Warning - > Folder "/rivers" because it isn't mandatory however is a ExtraFile
- Error - > Folder "/ocean" is a ExtraFile because that folder wasn't defined on JSON
-
list_of_files_found:
Commmand to run local
cargo run src/main.rs