mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
WIP: mostly scratch code still
This commit is contained in:
parent
e2e218bce9
commit
3471560eaa
20 changed files with 1757 additions and 1 deletions
21
src/pycalver/rewrite.py
Normal file
21
src/pycalver/rewrite.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env python
|
||||
# This file is part of the pycalver project
|
||||
# https://github.com/mbarkhau/pycalver
|
||||
#
|
||||
# (C) 2018 Manuel Barkhau (@mbarkhau)
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import logging
|
||||
import difflib
|
||||
|
||||
log = logging.getLogger("pycalver.rewrite")
|
||||
|
||||
|
||||
def rewrite_file(file: str, pattern: str, dry=False) -> None:
|
||||
difflib.unified_diff(
|
||||
file_content_before.splitlines(),
|
||||
file_content_after.splitlines(),
|
||||
lineterm="",
|
||||
fromfile="a/" + file,
|
||||
tofile="b/" + file,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue