mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Use realpath when comparing paths
This commit is contained in:
parent
fda996014b
commit
2e1d44dc23
|
@ -17,11 +17,19 @@ IGNORE_FILES = [
|
||||||
"src/engine/client/keynames.h",
|
"src/engine/client/keynames.h",
|
||||||
"src/engine/keys.h",
|
"src/engine/keys.h",
|
||||||
]
|
]
|
||||||
|
IGNORE_DIRS = [
|
||||||
|
"src/game/generated",
|
||||||
|
"src/rust-bridge"
|
||||||
|
]
|
||||||
def filter_ignored(filenames):
|
def filter_ignored(filenames):
|
||||||
return [filename for filename in filenames
|
result = []
|
||||||
if filename not in IGNORE_FILES
|
for filename in filenames:
|
||||||
and not filename.startswith("src/game/generated/")
|
real_filename = os.path.realpath(filename)
|
||||||
and not filename.startswith("src/rust-bridge")]
|
if real_filename not in [os.path.realpath(ignore_file) for ignore_file in IGNORE_FILES] \
|
||||||
|
and not any(real_filename.startswith(os.path.realpath(subdir) + os.path.sep) for subdir in IGNORE_DIRS):
|
||||||
|
result.append(filename)
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
def filter_cpp(filenames):
|
def filter_cpp(filenames):
|
||||||
return [filename for filename in filenames
|
return [filename for filename in filenames
|
||||||
|
|
Loading…
Reference in a new issue