architecture_lints 0.1.5
architecture_lints: ^0.1.5 copied to clipboard
A configuration-driven, architecture-agnostic linter for Dart & Flutter.
0.1.5 #
- Refactor: Improve parameter name matching in type safety rules
- Refactored
TypeSafetyLogicto differentiate between regular expression and exact string matching for parameter identifiers. - Introduced
matchesParameterNamewhich usesRegExponly if the pattern contains special regex characters; otherwise, it performs a strict equality check. - This prevents incorrect partial matches, for example, a rule for a parameter named
idno longer incorrectly applies to a parameter namedmiddleName.
- Refactored
0.1.4 #
- Refactor: Improve member identifier matching and code clarity.
0.1.3 #
- Feature: Introduced new grammar tokens for phrase validation.
- Added
noun.phrase,noun.singular.phrase,noun.plural.phrase. - Added
verb.phrase,verb.present.phrase,verb.past.phrase.
- Added
0.1.2 #
- Docs: Restructure and clarify README documentation
- Reorganized the
README.mdfor improved clarity and readability by converting descriptive paragraphs into structured tables for core concepts likemodulesandcomponents. - Separated
DefinitionsandPropertiesinto distinct sections with their own tables to clarify configuration structure. - Updated the table of contents with revised numbering and links.
- Improved and clarified descriptions for various properties, including
pattern,antipattern, andgrammartokens. - Refined type information in property tables for better accuracy (e.g.,
List<Enum>toSet<Enum>). - Removed an obsolete
Referencesection from the table of contents.
- Reorganized the
0.1.1 #
- Refactor: Replace language engine with
lexicorfromdictionaryxand enhance grammar logic. - Debug: Introduced
ArchLogger, a new tagged logging utility, to aid in debugging complex grammar and file resolution logic. - Docs:
- Restructured the
README.mdfor better readability by converting descriptive sections into clear, tabular formats. - Reorganized the table of contents and section numbering for a more logical flow.
- Clarified and expanded descriptions for
modules,components,actions, and other core concepts with detailed tables.
- Restructured the
0.1.0 #
π Initial Beta Release
The first release of Architecture Lints, a configuration-driven, architecture-agnostic static analysis engine.
π Core Features #
- Architecture Agnostic: Supports Clean Architecture, MVVM, MVC, Layer-First, Feature-First,
or any custom structure defined in
architecture.yaml. - Smart Resolution Engine:
FileResolver: Identifies architectural components based on file paths.ComponentRefiner: Disambiguates co-located files (e.g., Interface vs. Implementation) using AST analysis (Inheritance, Naming Patterns, and Structure).
- Configuration DSL:
- Definitions: Define reusable types, imports, and rewrites.
- Components: Define layers with
mode(namespace/file/part),kind(class/enum), andmodifier(abstract/sealed). - Expressions: Support for Dart-like syntax (
${source.name.pascalCase}) in configurations.
π‘οΈ Lint Rules #
- Boundaries:
arch_dep_component: Enforces strict dependency rules between layers (e.g., Domain cannot import UI).- Support for
allowed(whitelist) andforbidden(blacklist) imports.
- Naming:
arch_naming_pattern: Enforces regex patterns (e.g.,${name}UseCase).arch_naming_antipattern: Bans specific naming conventions.- NLP Support: Basic grammar checks (
${noun},${verb}) for semantic naming.
- Type Safety:
arch_safety_return_strict: Enforces return types (e.g.,FutureEither<T>).arch_safety_param_strict: Enforces parameter types (e.g.,UserIdinstead ofint).- Supports deep generic unwrapping and type aliases.
- Structure & Consistency:
arch_structure_modifier: Enforces Dart keywords (e.g., Interfaces must beabstract).arch_parity_missing: Detects missing companion files (e.g., Port missing its UseCase).
- Exceptions:
arch_exception_forbidden: Bans specific operations (throw/catch) per layer.
- Usage:
arch_usage_global_access: Detects and bans Service Locator usage in pure layers.
β‘ Automation (Actions) #
- Code Generation: Integrated Action Engine to generate code when rules are violated.
- Templates: Support for standard Mustache templates.
- Variable Resolver: Resolves context variables, imports, and logic for templates dynamically.
- Debug Mode:
debug_component_identityrule to visualize how the engine parses your code.