[clang-tools-extra] [run-clang-tidy] Accept directory as value for -export-fixes (PR #69453)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 07:18:36 PDT 2023


github-actions[bot] wrote:


<!--LLVM CODE FORMAT COMMENT: {darker}-->

:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r b0b8e83e668ac02f81874c3548c8eb8dbf3c33f0..d63de8e3d8e71df445983516a57cc41cf47f1a6e clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- run-clang-tidy.py	2023-10-18 14:03:58.000000 +0000
+++ run-clang-tidy.py	2023-10-18 14:18:29.065058 +0000
@@ -311,11 +311,11 @@
             metavar="file_or_directory",
             dest="export_fixes",
             help="A directory or a yaml file to store suggested fixes in, "
             "which can be applied with clang-apply-replacements. If the "
             "parameter is a directory, the fixes of each compilation unit are "
-            "stored in individual yaml files in the directory."
+            "stored in individual yaml files in the directory.",
         )
     parser.add_argument(
         "-j",
         type=int,
         default=0,
@@ -393,19 +393,21 @@
 
     combine_fixes = False
     export_fixes_dir = None
     delete_fixes_dir = True
     if args.export_fixes is not None:
-        assert not args.export_fixes.endswith(os.path.sep) or os.path.isdir(args.export_fixes), "The export fixes directory does not exist."
+        assert not args.export_fixes.endswith(os.path.sep) or os.path.isdir(
+            args.export_fixes
+        ), "The export fixes directory does not exist."
 
         if not os.path.isdir(args.export_fixes) and yaml:
             combine_fixes = True
-        
+
         if os.path.isdir(args.export_fixes):
             export_fixes_dir = args.export_fixes
             delete_fixes_dir = False
-        
+
     if export_fixes_dir is None and (args.fix or combine_fixes):
         export_fixes_dir = tempfile.mkdtemp()
 
     try:
         invocation = get_tidy_invocation(

``````````

</details>


https://github.com/llvm/llvm-project/pull/69453


More information about the cfe-commits mailing list