diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2017-06-09 22:23:03 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2017-06-09 22:23:03 +0000 |
commit | c4c33ce0973f63670b4ebf5bc674ce03b9fa541b (patch) | |
tree | 552d473c2f74d5bd4043112c7e93e3748c4ecd78 | |
parent | f3e877017b3317007d34746dee98d2fe623f61e0 (diff) | |
download | bcm5719-llvm-c4c33ce0973f63670b4ebf5bc674ce03b9fa541b.tar.gz bcm5719-llvm-c4c33ce0973f63670b4ebf5bc674ce03b9fa541b.zip |
[clang-tidy] D33930: Do not pick up by default the LLVM style if passing -format.
This adds a new flag -style which is passed to clang-apply-replacements and
defaults to file meaning it would pick up the closest .clang-format file in tree.
llvm-svn: 305125
-rwxr-xr-x | clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py index 0f2f55be236..d9d827b0129 100755 --- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py @@ -105,6 +105,8 @@ def apply_fixes(args, tmpdir): invocation = [args.clang_apply_replacements_binary] if args.format: invocation.append('-format') + if args.style: + invocation.append('-style=' + args.style) invocation.append(tmpdir) subprocess.call(invocation) @@ -148,6 +150,8 @@ def main(): parser.add_argument('-fix', action='store_true', help='apply fix-its') parser.add_argument('-format', action='store_true', help='Reformat code ' 'after applying fixes') + parser.add_argument('-style', default='file', help='The style of reformat ' + 'code after applying fixes') parser.add_argument('-p', dest='build_path', help='Path used to read a compile command database.') parser.add_argument('-extra-arg', dest='extra_arg', |