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