mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 22:40:09 +01:00
more coverage
This commit is contained in:
parent
4598286f12
commit
df492a20d6
10 changed files with 128 additions and 27 deletions
|
|
@ -109,6 +109,8 @@ def iter_rewritten(
|
|||
... ]
|
||||
>>>
|
||||
'''
|
||||
fh: typ.IO[str]
|
||||
|
||||
for filepath, patterns in file_patterns.items():
|
||||
with io.open(filepath, mode="rt", encoding="utf-8") as fh:
|
||||
content = fh.read()
|
||||
|
|
@ -151,6 +153,8 @@ def diff(new_version: str, file_patterns: config.PatternsByFilePath) -> str:
|
|||
|
||||
full_diff = ""
|
||||
file_path: str
|
||||
fh : typ.IO[str]
|
||||
|
||||
for file_path, patterns in sorted(file_patterns.items()):
|
||||
with io.open(file_path, mode="rt", encoding="utf-8") as fh:
|
||||
content = fh.read()
|
||||
|
|
@ -165,6 +169,7 @@ def diff(new_version: str, file_patterns: config.PatternsByFilePath) -> str:
|
|||
|
||||
def rewrite(new_version: str, file_patterns: config.PatternsByFilePath) -> None:
|
||||
"""Rewrite project files, updating each with the new version."""
|
||||
fh: typ.IO[str]
|
||||
|
||||
for file_data in iter_rewritten(file_patterns, new_version):
|
||||
new_content = file_data.line_sep.join(file_data.new_lines)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue