Skip to content
Closed
12 changes: 10 additions & 2 deletions clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ def find_binary(arg: str, name: str, build_path: str) -> str:
def apply_fixes(
args: argparse.Namespace, clang_apply_replacements_binary: str, tmpdir: str
) -> None:
"""Calls clang-apply-fixes on a given directory."""
"""Calls clang-apply-replacements on a given directory."""
invocation = [clang_apply_replacements_binary]
invocation.append("-ignore-insert-conflict")

if args.ignore_insert_conflict:
invocation.append("-ignore-insert-conflict")
if args.format:
invocation.append("-format")
if args.style:
Expand Down Expand Up @@ -446,6 +448,12 @@ async def main() -> None:
action="store_true",
help="Allow empty enabled checks.",
)
parser.add_argument(
"-ignore-insert-conflict",
action="store_true",
default=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be false by default and toggled to true when the option is present?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asked to preserve current behaviour

help="Ignore insert conflict when applying fixes.",
)
args = parser.parse_args()

db_path = "compile_commands.json"
Expand Down