[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich created https://github.com/llvm/llvm-project/pull/75457 Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. >From 05aff16d9b117e7e04c5342ec1792c91ef41e48b Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 4 1 file changed, 4 insertions(+) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..53c990f58a7edc 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,8 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument("-config-file", dest="config_file", +help="Specify the path of .clang-tidy or custom config file",default="") parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +315,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From 382a8a5355b06f191941099c1eac029dbb9d4bb4 Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 8 1 file changed, 8 insertions(+) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
MichaelLettrich wrote: Note: This file lacks a `SPDX-FileCopyrightText:` in the header. Is this on purpose? https://github.com/llvm/llvm-project/pull/75457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From 382a8a5355b06f191941099c1eac029dbb9d4bb4 Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH 1/2] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 8 1 file changed, 8 insertions(+) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: >From 9ef2829e44f2b8ad27b58e74c4068f2c72aba69b Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Mon, 18 Dec 2023 09:12:30 +0100 Subject: [PATCH 2/2] Add to ReleaseNotes.rst Document changes to clang-tidy-diff in release notes. --- clang-tools-extra/docs/ReleaseNotes.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 6d91748e4cef18..7c568d1e94d9f4 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -128,6 +128,11 @@ Improvements to clang-tidy as a value for `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. It now accepts a `-config-file` option + to pass in a configuration file to :program:`clang-tidy`. This option corresponds + to the `--config-file` option in :program:`clang-tidy`. + + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From 64fbf57d93ef3569f89b3f4d770cc849bc4b3604 Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 8 clang-tools-extra/docs/ReleaseNotes.rst | 5 + 2 files changed, 13 insertions(+) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 6d91748e4cef18..7c568d1e94d9f4 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -128,6 +128,11 @@ Improvements to clang-tidy as a value for `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. It now accepts a `-config-file` option + to pass in a configuration file to :program:`clang-tidy`. This option corresponds + to the `--config-file` option in :program:`clang-tidy`. + + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
MichaelLettrich wrote: @PiotrZSL thanks for the review I added the to the release notes as requested. @cjappl thanks for mentioning. I copied and adapted your release notes into this branch. https://github.com/llvm/llvm-project/pull/75457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From d8792b4cd884b7c79254db6eff104ebdbfbbe6ce Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- .../clang-tidy/tool/clang-tidy-diff.py| 8 clang-tools-extra/docs/ReleaseNotes.rst | 15 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 6d91748e4cef18..814e35d9c841bc 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -119,15 +119,22 @@ Improvements to clang-tidy - Improved `--dump-config` to print check options in alphabetical order. -- Improved :program:`clang-tidy-diff.py` script. It now returns exit code `1` - if any :program:`clang-tidy` subprocess exits with a non-zero code or if - exporting fixes fails. It now accepts a directory as a value for - `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. +* Return exit code `1` if any :program:`clang-tidy` subprocess exits with +a non-zero code or if exporting fixes fails. + +* Accept a directory as a value for `-export-fixes` to export individual +yaml files for each compilation unit. + +* Introduce a `-config-file` option that forwards a configuration file to +:program:`clang-tidy`. Coresponds to the `--config-file` option in +:program:`clang-tidy`. - Improved :program:`run-clang-tidy.py` script. It now accepts a directory as a value for `-export-fixes` to export individual yaml files for each compilation unit. + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From e099795e909b85c5a99f3f8464e93d98da75fbb5 Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- .../clang-tidy/tool/clang-tidy-diff.py| 8 clang-tools-extra/docs/ReleaseNotes.rst | 15 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 6d91748e4cef18..dec210114876e4 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -119,15 +119,22 @@ Improvements to clang-tidy - Improved `--dump-config` to print check options in alphabetical order. -- Improved :program:`clang-tidy-diff.py` script. It now returns exit code `1` - if any :program:`clang-tidy` subprocess exits with a non-zero code or if - exporting fixes fails. It now accepts a directory as a value for - `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. +* Return exit code `1` if any :program:`clang-tidy` subprocess exits with +a non-zero code or if exporting fixes fails. + +* Accept a directory as a value for `-export-fixes` to export individual +yaml files for each compilation unit. + +* Introduce a `-config-file` option that forwards a configuration file to +:program:`clang-tidy`. Coresponds to the `--config-file` option in +:program:`clang-tidy`. - Improved :program:`run-clang-tidy.py` script. It now accepts a directory as a value for `-export-fixes` to export individual yaml files for each compilation unit. + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
https://github.com/MichaelLettrich updated https://github.com/llvm/llvm-project/pull/75457 >From 4a33210fc3b0b6f6dc8152cea86c8ecc2c46fa0c Mon Sep 17 00:00:00 2001 From: Michael Lettrich Date: Thu, 14 Dec 2023 11:31:28 +0100 Subject: [PATCH] Allow to pass config file to clang-tidy-diff Adds a `-config-file` command line option that passes on the path of .`clang-tidy` or custom config file to the `clang-tidy` executable. --- .../clang-tidy/tool/clang-tidy-diff.py| 8 clang-tools-extra/docs/ReleaseNotes.rst | 15 +++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py index 8817e2914f6e25..d96b3450fdbe81 100755 --- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py @@ -173,6 +173,12 @@ def main(): help="checks filter, when not specified, use clang-tidy " "default", default="", ) +parser.add_argument( +"-config-file", +dest="config_file", +help="Specify the path of .clang-tidy or custom config file", +default="", +) parser.add_argument("-use-color", action="store_true", help="Use colors in output") parser.add_argument( "-path", dest="build_path", help="Path used to read a compile command database." @@ -313,6 +319,8 @@ def main(): common_clang_tidy_args.append("-fix") if args.checks != "": common_clang_tidy_args.append("-checks=" + args.checks) +if args.config_file != "": +common_clang_tidy_args.append("-config-file=" + args.config_file) if args.quiet: common_clang_tidy_args.append("-quiet") if args.build_path is not None: diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 6d91748e4cef18..ca390c628e96a0 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -119,15 +119,22 @@ Improvements to clang-tidy - Improved `--dump-config` to print check options in alphabetical order. -- Improved :program:`clang-tidy-diff.py` script. It now returns exit code `1` - if any :program:`clang-tidy` subprocess exits with a non-zero code or if - exporting fixes fails. It now accepts a directory as a value for - `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. +* Return exit code `1` if any :program:`clang-tidy` subprocess exits with + a non-zero code or if exporting fixes fails. + +* Accept a directory as a value for `-export-fixes` to export individual + yaml files for each compilation unit. + +* Introduce a `-config-file` option that forwards a configuration file to + :program:`clang-tidy`. Corresponds to the `--config-file` option in + :program:`clang-tidy`. - Improved :program:`run-clang-tidy.py` script. It now accepts a directory as a value for `-export-fixes` to export individual yaml files for each compilation unit. + New checks ^^ ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)
@@ -128,6 +128,11 @@ Improvements to clang-tidy as a value for `-export-fixes` to export individual yaml files for each compilation unit. +- Improved :program:`clang-tidy-diff.py` script. It now accepts a `-config-file` option MichaelLettrich wrote: Hope this is better now - unless nesting bullet points is not desirable. https://github.com/llvm/llvm-project/pull/75457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits