Skip to content

v1.11.0 - Configuration-Driven Line Counter

Choose a tag to compare

@Gronsten Gronsten released this 29 Nov 05:15
· 25 commits to main since this release
0c2fbc0

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
  • 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:

  1. Edit config.json
  2. Navigate to the lineCounter section
  3. Add or modify exclusions as needed
  4. See config.example.json for 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 bump
  • config.example.json - Added lineCounter schema and version bump
  • scripts/count-lines.py - Refactored to use config-based exclusions
  • ARCHITECTURE.md - Added lineCounter documentation
  • CHANGELOG.md - v1.11.0 release notes

Full Changelog

See CHANGELOG.md for complete details.