MCPcopy Index your code
hub / github.com/commitizen-tools/commitizen / _resolve_files_and_regexes

Function _resolve_files_and_regexes

commitizen/bump.py:115–130  ·  view source on GitHub ↗

Resolve all distinct files with their regexp from a list of glob patterns with optional regexp

(
    patterns: Iterable[str], version: str
)

Source from the content-addressed store, hash-verified

113
114
115def _resolve_files_and_regexes(
116 patterns: Iterable[str], version: str
117) -> Generator[tuple[str, re.Pattern], None, None]:
118 """
119 Resolve all distinct files with their regexp from a list of glob patterns with optional regexp
120 """
121 filepath_set: set[tuple[str, str]] = set()
122 for pattern in patterns:
123 drive, tail = os.path.splitdrive(pattern)
124 path, _, regex = tail.partition(":")
125 filepath = drive + path
126 regex = regex or re.escape(version)
127
128 filepath_set.update((path, regex) for path in iglob(filepath))
129
130 return ((path, re.compile(regex)) for path, regex in sorted(filepath_set))
131
132
133def create_commit_message(

Callers 1

update_version_in_filesFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…