Skip to content

v1.1.1 — Exclude Pattern Fix

Choose a tag to compare

@ericodx ericodx released this 19 Mar 23:59
· 214 commits to main since this release
ee283f5

Bug fix for the exclude key in .swift-cpd.yml.


What's new

Bug Fix

  • Fixed exclude patterns in .swift-cpd.yml and --exclude having no effect when using relative paths or directory paths with a trailing slash
  • Root cause: GlobMatcher anchored all patterns with ^, making them impossible to match against absolute file paths. Directory patterns ending with / also failed to match url.path, which never includes a trailing slash
  • Relative patterns now match at path-component boundaries anywhere in the absolute file path
  • Directory patterns ending with / now correctly exclude the directory and all files within it, enabling early pruning via
    skipDescendants()

Documentation

  • GlobMatcher matching semantics documented — absolute vs. relative patterns, directory trailing-slash behavior
  • File discovery flowchart corrected to reflect that shouldExclude is evaluated for every enumerated item, including directories
  • exclude YAML reference updated with clarifying comments and a directory-pattern example

Requirements

  • macOS 15+
  • Swift 6.2+

Installation

See the Installation Guide for Homebrew, pre-built binary, SPM plugin, and git hook setup.


What's Changed

  • fix: exclude key in .swift-cpd.yml has no effect by @ericodx in #9

Full Changelog: v1.1.0...v1.1.1