code_clean: fix incorrect check to exclude C files from C++ cleanups

This commit is contained in:
Campbell Barton
2023-02-12 15:20:49 +11:00
parent 2603fa7792
commit 20ca64e4ac

View File

@ -539,8 +539,8 @@ class edit_generators:
def edit_list_from_file(source: str, data: str, _shared_edit_data: Any) -> List[Edit]:
edits: List[Edit] = []
# The user might exclude C++, if they forget, it is better not to operate on C.
if not source.lower().endswith((".h", ".c")):
# The user might include C & C++, if they forget, it is better not to operate on C.
if source.lower().endswith((".h", ".c")):
return edits
# `NULL` -> `nullptr`.
@ -575,8 +575,8 @@ class edit_generators:
def edit_list_from_file(source: str, data: str, _shared_edit_data: Any) -> List[Edit]:
edits: List[Edit] = []
# The user might exclude C++, if they forget, it is better not to operate on C.
if not source.lower().endswith((".h", ".c")):
# The user might include C & C++, if they forget, it is better not to operate on C.
if source.lower().endswith((".h", ".c")):
return edits
# `UNUSED(arg)` -> `/*arg*/`.