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 8
8
9
9
PACKAGE_ROOT = Path (__file__ ).absolute ().parent .parent
10
10
11
+
11
12
@functools .lru_cache ()
12
13
def load_gitignore (repo ):
13
- gitignore = repo / ' .gitignore'
14
+ gitignore = repo / " .gitignore"
14
15
ignore = [fnmatch .translate (".git/" ), fnmatch .translate (Path (__file__ ).name )]
15
16
if gitignore .exists ():
16
17
ignore .extend (
17
18
fnmatch .translate (line .strip ())
18
19
for line in gitignore .read_text ().splitlines ()
19
- if line .strip () and not line [0 ] == '#'
20
+ if line .strip () and not line [0 ] == "#"
20
21
)
21
- return re .compile ('|' .join (ignore ))
22
+ return re .compile ("|" .join (ignore ))
23
+
22
24
23
25
cmd , new_name , * _ = sys .argv
24
26
@@ -31,7 +33,7 @@ def load_gitignore(repo):
31
33
32
34
root = Path (root )
33
35
for src in list (dirs ):
34
- if ' TODO' in src :
36
+ if " TODO" in src :
35
37
dst = src .replace ("TODO" , new_name )
36
38
print (f"Renaming: { root / src } -> { root / dst } " )
37
39
os .rename (root / src , root / dst )
@@ -40,6 +42,6 @@ def load_gitignore(repo):
40
42
for fname in files :
41
43
f = root / fname
42
44
text = Path .read_text (root / fname )
43
- if ' TODO' in text :
45
+ if " TODO" in text :
44
46
print (f"Rewriting: { root / fname } " )
45
47
Path .write_text (root / fname , text .replace ("TODO" , new_name ))
You can’t perform that action at this time.
0 commit comments