Configuration File
The configuration follows a JSON Schema to enforce validation and standardization.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"basePackage": { "type": "string" },
"fileRule": { "$ref": "#/definitions/fileRule" },
"directoriesRule": { "$ref": "#/definitions/directoriesRule" }
},
"required": ["directoriesRule"],
"definitions": {
"fileRule": {
"type": "object",
"properties": {
"level": {
"type": "string",
"enum": ["OFF", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"],
"default": "WARNING"
},
"naming": {
"type": "string",
"enum": ["ENDS_WITH", "ENDS_WITH_LAYERED", "STARTS_WITH"]
},
"namingArg": { "type": "string" },
"namingArgs": { "type": "array", "items": { "type": "string" } },
"ignoreFiles": { "type": "array", "items": { "type": "string" } }
},
"required": ["naming"]
},
"directoriesRule": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"enum": [
"LAYERED", "HEXAGONAL", "DOMAIN_DRIVEN",
"IMPLEMENTATION", "ENDS_WITH", "STARTS_WITH", "CONTAINS"
]
},
"patternArg": { "type": "string" },
"patternArgs": { "type": "array", "items": { "type": "string" } },
"level": {
"type": "string",
"enum": ["OFF", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"],
"default": "WARNING"
},
"basePackage": { "type": "string" },
"ignorePackages": { "type": "array", "items": { "type": "string" } },
"directoriesRule": { "$ref": "#/definitions/directoriesRule" },
"fileRule": { "$ref": "#/definitions/fileRule" }
},
"required": ["pattern"]
}
}
}
Configuration Fields Explained
Field | Type | Required | Description |
---|---|---|---|
basePackage | string | ❌ | The root package where validation starts. Limits checks to a specific namespace or module. |
fileRule | object | ❌ | Defines file naming conventions and validation rules. |
fileRule.level | string | ❌ | Log level for rule violations. Options: OFF , TRACE , DEBUG , INFO , WARN , ERROR , FATAL . Default: WARNING . |
fileRule.naming | string | ✅ | Defines how file names are validated. Options: ENDS_WITH , ENDS_WITH_LAYERED , STARTS_WITH . |
fileRule.namingArg | string | ❌ | Specifies a single argument for file naming validation. Example: "Service" → UserService.java . |
fileRule.namingArgs | array | ❌ | Allows multiple naming arguments. Example: ["Service", "Controller"] allows UserService.java & UserController.java . |
fileRule.ignoreFiles | array | ❌ | List of files to ignore from validation (e.g., README.md , config.xml ). |
directoriesRule | object | ✅ | Defines folder structure validation rules. |
directoriesRule.pattern | string | ✅ | Specifies the project structure type. Options: LAYERED , HEXAGONAL , DOMAIN_DRIVEN , IMPLEMENTATION , ENDS_WITH , STARTS_WITH , CONTAINS . |
directoriesRule.patternArg | string | ❌ | Defines a single argument for directory validation (e.g., "Module" → UserModule , OrderModule ). |
directoriesRule.patternArgs | array | ❌ | Allows multiple arguments for directory validation. |
directoriesRule.level | string | ❌ | Log level for directory rule violations. Options: OFF , TRACE , DEBUG , INFO , WARN , ERROR , FATAL . Default: WARNING . |
directoriesRule.basePackage | string | ❌ | The root directory where validation starts. |
directoriesRule.ignorePackages | array | ❌ | List of directories to ignore from validation (e.g., test , generated ). |
directoriesRule.directoriesRule | object | ❌ | Allows nested directory validation rules within a parent rule. |
directoriesRule.fileRule | object | ❌ | Allows file validation rules within a directory rule. |
🚀 Upcoming Enhancements:
- Support for multiple configuration files.
- Ability to merge configurations dynamically.
- XML/YAML support based on user demand.