mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
docs: update README with new features
- Add Entity Exposure Detection to features - Add Dependency Direction Enforcement to features - Add Repository Pattern Validation to features - Update API documentation with all 8 violation types - Add severity levels to all interfaces - Document --limit option with examples - Update ProjectMetrics interface - Update test statistics (292 tests, 90.63% coverage)
This commit is contained in:
@@ -19,12 +19,14 @@ Code quality guardian for vibe coders and enterprise teams - because AI writes f
|
|||||||
- 📝 Magic strings (URLs, connection strings, etc.)
|
- 📝 Magic strings (URLs, connection strings, etc.)
|
||||||
- 🎯 Smart context analysis
|
- 🎯 Smart context analysis
|
||||||
- 💡 Automatic constant name suggestions
|
- 💡 Automatic constant name suggestions
|
||||||
|
- 📍 Suggested location for constants
|
||||||
|
|
||||||
🔄 **Circular Dependency Detection**
|
🔄 **Circular Dependency Detection**
|
||||||
- Detects import cycles in your codebase
|
- Detects import cycles in your codebase
|
||||||
- Shows complete dependency chain
|
- Shows complete dependency chain
|
||||||
- Helps maintain clean architecture
|
- Helps maintain clean architecture
|
||||||
- Prevents maintenance nightmares
|
- Prevents maintenance nightmares
|
||||||
|
- Severity-based reporting
|
||||||
|
|
||||||
📝 **Naming Convention Detection**
|
📝 **Naming Convention Detection**
|
||||||
- Layer-based naming rules enforcement
|
- Layer-based naming rules enforcement
|
||||||
@@ -42,6 +44,27 @@ Code quality guardian for vibe coders and enterprise teams - because AI writes f
|
|||||||
- Maintains clean domain boundaries
|
- Maintains clean domain boundaries
|
||||||
- Prevents infrastructure coupling in business logic
|
- Prevents infrastructure coupling in business logic
|
||||||
|
|
||||||
|
🎭 **Entity Exposure Detection**
|
||||||
|
- Detects domain entities exposed in API responses
|
||||||
|
- Prevents data leakage through direct entity returns
|
||||||
|
- Enforces DTO/Response object usage
|
||||||
|
- Layer-aware validation
|
||||||
|
- Smart suggestions for proper DTOs
|
||||||
|
|
||||||
|
⬆️ **Dependency Direction Enforcement**
|
||||||
|
- Validates Clean Architecture layer dependencies
|
||||||
|
- Domain → Application → Infrastructure flow
|
||||||
|
- Prevents backwards dependencies
|
||||||
|
- Maintains architectural boundaries
|
||||||
|
- Detailed violation reports
|
||||||
|
|
||||||
|
📦 **Repository Pattern Validation**
|
||||||
|
- Validates repository interface design
|
||||||
|
- Detects ORM/technical types in interfaces
|
||||||
|
- Checks for technical method names (findOne, save, etc.)
|
||||||
|
- Enforces domain language usage
|
||||||
|
- Prevents "new Repository()" anti-pattern
|
||||||
|
|
||||||
🏗️ **Clean Architecture Enforcement**
|
🏗️ **Clean Architecture Enforcement**
|
||||||
- Built with DDD principles
|
- Built with DDD principles
|
||||||
- Layered architecture (Domain, Application, Infrastructure)
|
- Layered architecture (Domain, Application, Infrastructure)
|
||||||
@@ -354,6 +377,17 @@ npx @samiyev/guardian check ./src --verbose
|
|||||||
npx @samiyev/guardian check ./src --no-hardcode # Skip hardcode detection
|
npx @samiyev/guardian check ./src --no-hardcode # Skip hardcode detection
|
||||||
npx @samiyev/guardian check ./src --no-architecture # Skip architecture checks
|
npx @samiyev/guardian check ./src --no-architecture # Skip architecture checks
|
||||||
|
|
||||||
|
# Filter by severity
|
||||||
|
npx @samiyev/guardian check ./src --min-severity high # Show high, critical only
|
||||||
|
npx @samiyev/guardian check ./src --only-critical # Show only critical issues
|
||||||
|
|
||||||
|
# Limit detailed output (useful for large codebases)
|
||||||
|
npx @samiyev/guardian check ./src --limit 10 # Show first 10 violations per category
|
||||||
|
npx @samiyev/guardian check ./src -l 20 # Short form
|
||||||
|
|
||||||
|
# Combine options
|
||||||
|
npx @samiyev/guardian check ./src --only-critical --limit 5 # Top 5 critical issues
|
||||||
|
|
||||||
# Show help
|
# Show help
|
||||||
npx @samiyev/guardian --help
|
npx @samiyev/guardian --help
|
||||||
|
|
||||||
@@ -450,9 +484,17 @@ interface AnalyzeProjectRequest {
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
interface AnalyzeProjectResponse {
|
interface AnalyzeProjectResponse {
|
||||||
|
// Violations
|
||||||
hardcodeViolations: HardcodeViolation[]
|
hardcodeViolations: HardcodeViolation[]
|
||||||
architectureViolations: ArchitectureViolation[]
|
violations: ArchitectureViolation[]
|
||||||
circularDependencyViolations: CircularDependencyViolation[]
|
circularDependencyViolations: CircularDependencyViolation[]
|
||||||
|
namingViolations: NamingViolation[]
|
||||||
|
frameworkLeakViolations: FrameworkLeakViolation[]
|
||||||
|
entityExposureViolations: EntityExposureViolation[]
|
||||||
|
dependencyDirectionViolations: DependencyDirectionViolation[]
|
||||||
|
repositoryPatternViolations: RepositoryPatternViolation[]
|
||||||
|
|
||||||
|
// Metrics
|
||||||
metrics: ProjectMetrics
|
metrics: ProjectMetrics
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,21 +505,80 @@ interface HardcodeViolation {
|
|||||||
type: "magic-number" | "magic-string"
|
type: "magic-number" | "magic-string"
|
||||||
value: string | number
|
value: string | number
|
||||||
context: string
|
context: string
|
||||||
suggestedConstantName: string
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
suggestedLocation: string
|
suggestion: {
|
||||||
|
constantName: string
|
||||||
|
location: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CircularDependencyViolation {
|
interface CircularDependencyViolation {
|
||||||
rule: "circular-dependency"
|
rule: "circular-dependency"
|
||||||
message: string
|
message: string
|
||||||
cycle: string[]
|
cycle: string[]
|
||||||
severity: "error"
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NamingViolation {
|
||||||
|
file: string
|
||||||
|
fileName: string
|
||||||
|
layer: string
|
||||||
|
type: string
|
||||||
|
message: string
|
||||||
|
suggestion?: string
|
||||||
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FrameworkLeakViolation {
|
||||||
|
file: string
|
||||||
|
packageName: string
|
||||||
|
category: string
|
||||||
|
categoryDescription: string
|
||||||
|
layer: string
|
||||||
|
rule: string
|
||||||
|
message: string
|
||||||
|
suggestion: string
|
||||||
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface EntityExposureViolation {
|
||||||
|
file: string
|
||||||
|
line?: number
|
||||||
|
entityName: string
|
||||||
|
returnType: string
|
||||||
|
methodName?: string
|
||||||
|
layer: string
|
||||||
|
rule: string
|
||||||
|
message: string
|
||||||
|
suggestion: string
|
||||||
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DependencyDirectionViolation {
|
||||||
|
file: string
|
||||||
|
fromLayer: string
|
||||||
|
toLayer: string
|
||||||
|
importPath: string
|
||||||
|
message: string
|
||||||
|
suggestion: string
|
||||||
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RepositoryPatternViolation {
|
||||||
|
file: string
|
||||||
|
layer: string
|
||||||
|
violationType: string
|
||||||
|
details: string
|
||||||
|
message: string
|
||||||
|
suggestion: string
|
||||||
|
severity: "critical" | "high" | "medium" | "low"
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProjectMetrics {
|
interface ProjectMetrics {
|
||||||
totalFiles: number
|
totalFiles: number
|
||||||
analyzedFiles: number
|
totalFunctions: number
|
||||||
totalLines: number
|
totalImports: number
|
||||||
|
layerDistribution: Record<string, number>
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user