v1.11.0 - Configuration-Driven Line Counter
Configuration-Driven Line Counter Exclusions
This release refactors the line counter to use configuration-based exclusions instead of hardcoded rules, making it easier to customize which files/directories are excluded from counts without modifying code.
What's New
Configuration Schema
Added new lineCounter section to config.json with flexible exclusion rules:
-
Global Exclusions - Apply to all projects:
- Extensions:
.log,.vsix,.vhdx,.avhdx(Hyper-V VM files) - Path patterns:
log
- Extensions:
-
Project-Specific Exclusions - Customize per project:
- Exact filenames
- Wildcard patterns (e.g.,
temp_*) - File extensions
- Path patterns
- Whitelist mode (
includeOnly) - Full exclusion (
excludeAll)
Code Improvements
- All hardcoded exclusions removed from
count-lines.py - Config-driven exclusion system with wildcard pattern matching
- Better maintainability and user customization
- Backward compatible with graceful fallback
Documentation Updates
- Comprehensive ARCHITECTURE.md documentation of lineCounter config schema
- Enhanced Code Line Counter section with configuration details
- Example configurations in config.example.json
Breaking Changes
None - existing configurations will continue to work with default exclusions.
Migration Guide
Config Changes Required
Updated configVersion: 1.8.1 → 1.9.0
The lineCounter section is now available in config.json. To customize exclusions:
- Edit
config.json - Navigate to the
lineCountersection - Add or modify exclusions as needed
- See
config.example.jsonfor examples
Example Configuration
"lineCounter": {
"globalExclusions": {
"extensions": [".log", ".vsix", ".vhdx", ".avhdx"],
"pathPatterns": ["log"]
},
"projectExclusions": {
"my-project": {
"files": ["package-lock.json"],
"pathPatterns": ["backup", "_prod"]
}
}
}Version Updates
- Console version: 1.11.0
- Config version: 1.9.0
Files Changed
console.ps1- Version bumpconfig.example.json- Added lineCounter schema and version bumpscripts/count-lines.py- Refactored to use config-based exclusionsARCHITECTURE.md- Added lineCounter documentationCHANGELOG.md- v1.11.0 release notes
Full Changelog
See CHANGELOG.md for complete details.