File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 88
99PACKAGE_ROOT = Path (__file__ ).absolute ().parent .parent
1010
11+
1112@functools .lru_cache ()
1213def load_gitignore (repo ):
13- gitignore = repo / ' .gitignore'
14+ gitignore = repo / " .gitignore"
1415 ignore = [fnmatch .translate (".git/" ), fnmatch .translate (Path (__file__ ).name )]
1516 if gitignore .exists ():
1617 ignore .extend (
1718 fnmatch .translate (line .strip ())
1819 for line in gitignore .read_text ().splitlines ()
19- if line .strip () and not line [0 ] == '#'
20+ if line .strip () and not line [0 ] == "#"
2021 )
21- return re .compile ('|' .join (ignore ))
22+ return re .compile ("|" .join (ignore ))
23+
2224
2325cmd , new_name , * _ = sys .argv
2426
@@ -31,7 +33,7 @@ def load_gitignore(repo):
3133
3234 root = Path (root )
3335 for src in list (dirs ):
34- if ' TODO' in src :
36+ if " TODO" in src :
3537 dst = src .replace ("TODO" , new_name )
3638 print (f"Renaming: { root / src } -> { root / dst } " )
3739 os .rename (root / src , root / dst )
@@ -40,6 +42,6 @@ def load_gitignore(repo):
4042 for fname in files :
4143 f = root / fname
4244 text = Path .read_text (root / fname )
43- if ' TODO' in text :
45+ if " TODO" in text :
4446 print (f"Rewriting: { root / fname } " )
4547 Path .write_text (root / fname , text .replace ("TODO" , new_name ))
You can’t perform that action at this time.
0 commit comments