mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
scripts: Ignore editor temporary files
Ignore editor temporary files when autostyling in: * rectify_include_paths.py * rename_c_identifier.py Obviously correct changes to already-reviewed code.
This commit is contained in:
parent
442e0caea2
commit
a762234ba2
@ -29,6 +29,12 @@ def get_include_map():
|
|||||||
exclude(["ext", "win32"], dirnames)
|
exclude(["ext", "win32"], dirnames)
|
||||||
|
|
||||||
for fname in fnames:
|
for fname in fnames:
|
||||||
|
# Avoid editor temporary files
|
||||||
|
if fname.startswith("."):
|
||||||
|
continue
|
||||||
|
if fname.startswith("#"):
|
||||||
|
continue
|
||||||
|
|
||||||
if fname.endswith(".h"):
|
if fname.endswith(".h"):
|
||||||
if fname in includes:
|
if fname in includes:
|
||||||
warn("Multiple headers named %s"%fname)
|
warn("Multiple headers named %s"%fname)
|
||||||
@ -63,6 +69,12 @@ for dirpath,dirnames,fnames in os.walk("src"):
|
|||||||
exclude(["trunnel"], dirnames)
|
exclude(["trunnel"], dirnames)
|
||||||
|
|
||||||
for fname in fnames:
|
for fname in fnames:
|
||||||
|
# Avoid editor temporary files
|
||||||
|
if fname.startswith("."):
|
||||||
|
continue
|
||||||
|
if fname.startswith("#"):
|
||||||
|
continue
|
||||||
|
|
||||||
if fname.endswith(".c") or fname.endswith(".h"):
|
if fname.endswith(".c") or fname.endswith(".h"):
|
||||||
fname = os.path.join(dirpath, fname)
|
fname = os.path.join(dirpath, fname)
|
||||||
tmpfile = fname+".tmp"
|
tmpfile = fname+".tmp"
|
||||||
|
@ -44,7 +44,8 @@ def is_c_file(fn):
|
|||||||
False
|
False
|
||||||
"""
|
"""
|
||||||
fn = os.path.split(fn)[1]
|
fn = os.path.split(fn)[1]
|
||||||
if fn.startswith("."):
|
# Avoid editor temporary files
|
||||||
|
if fn.startswith(".") or fn.startswith("#"):
|
||||||
return False
|
return False
|
||||||
ext = os.path.splitext(fn)[1]
|
ext = os.path.splitext(fn)[1]
|
||||||
return ext in {".c", ".h", ".i", ".inc"}
|
return ext in {".c", ".h", ".i", ".inc"}
|
||||||
|
Loading…
Reference in New Issue
Block a user