[PATCH] D69746: [analyzer] FixItHint: Apply and test hints with the Clang Tidy's script
Csaba Dabis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 30 09:39:32 PST 2020
Charusso added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:92
+
+ bool IncludePath = false, ShouldEmitAsError = false, FixitsAsRemarks = false,
+ ApplyFixIts = false;
----------------
NoQ wrote:
> I'll be perfectly happy with removing `FixitsAsRemarks` entirely. Your new mechanism is superior.
Okai, challenge accepted. Thanks!
================
Comment at: clang/test/Analysis/check_analyzer_fixit.py:1
+#!/usr/bin/env python
+#
----------------
lebedev.ri wrote:
> This does work with python3?
I think it should. It is only made for running by the `lit` which is left in Python 2.
================
Comment at: clang/test/Analysis/check_analyzer_fixit.py:50-51
+ clang_dir = clang_dir.strip()
+ if sys.platform in ['win32']:
+ clang_dir = clang_dir.replace('\\', '/')
+
----------------
NoQ wrote:
> I think there must be an `os.path` function for this.
I hope it is `os.path.normpath()`.
================
Comment at: clang/test/Analysis/check_analyzer_fixit.py:59
+ f.write(text)
+ f.truncate()
+
----------------
NoQ wrote:
> Mmm, what does this do?
I think an empty `truncate()` does not do anything, so removed.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69746/new/
https://reviews.llvm.org/D69746
More information about the cfe-commits
mailing list