WIP WIP - Bug 1480089 - pass all of the test files to to our static-analysis pipeline. draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 01 Aug 2018 10:02:07 +0300
changeset 825859 7f7a0faa9818390ce40d4f15cff865564ddea0e4
parent 825858 a2d65d03e46a9a42b5bee5c2a7864d3f987a8ca7
push id118186
push userbmo:bpostelnicu@mozilla.com
push dateThu, 02 Aug 2018 13:24:00 +0000
bugs1480089
milestone63.0a1
WIP WIP - Bug 1480089 - pass all of the test files to to our static-analysis pipeline. MozReview-Commit-ID: 33lifwtGx8e
python/mozbuild/mozbuild/mach_commands.py
tools/clang-tidy/test/bugprone-suspicious-memset-usage.json
tools/clang-tidy/test/clang-analyzer-cplusplus.NewDelete.json
tools/clang-tidy/test/clang-analyzer-cplusplus.NewDeleteLeaks.json
tools/clang-tidy/test/clang-analyzer-deadcode.DeadStores.json
tools/clang-tidy/test/clang-analyzer-security.FloatLoopCounter.json
tools/clang-tidy/test/clang-analyzer-security.insecureAPI.UncheckedReturn.json
tools/clang-tidy/test/clang-analyzer-security.insecureAPI.getpw.json
tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mkstemp.json
tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mktemp.json
tools/clang-tidy/test/clang-analyzer-security.insecureAPI.vfork.json
tools/clang-tidy/test/clang-analyzer-unix.Malloc.json
tools/clang-tidy/test/clang-analyzer-unix.cstring.BadSizeArg.json
tools/clang-tidy/test/clang-analyzer-unix.cstring.NullArg.json
tools/clang-tidy/test/misc-argument-comment.json
tools/clang-tidy/test/misc-assert-side-effect.json
tools/clang-tidy/test/misc-bool-pointer-implicit-conversion.json
tools/clang-tidy/test/misc-forward-declaration-namespace.json
tools/clang-tidy/test/misc-macro-repeated-side-effects.json
tools/clang-tidy/test/misc-string-constructor.json
tools/clang-tidy/test/misc-string-integer-assignment.json
tools/clang-tidy/test/misc-suspicious-missing-comma.json
tools/clang-tidy/test/misc-suspicious-semicolon.json
tools/clang-tidy/test/misc-swapped-arguments.json
tools/clang-tidy/test/misc-unused-alias-decls.json
tools/clang-tidy/test/misc-unused-raii.json
tools/clang-tidy/test/misc-unused-using-decls.json
tools/clang-tidy/test/modernize-avoid-bind.json
tools/clang-tidy/test/modernize-loop-convert.json
tools/clang-tidy/test/modernize-raw-string-literal.json
tools/clang-tidy/test/modernize-shrink-to-fit.json
tools/clang-tidy/test/modernize-use-bool-literals.json
tools/clang-tidy/test/modernize-use-equals-default.json
tools/clang-tidy/test/modernize-use-equals-delete.json
tools/clang-tidy/test/modernize-use-nullptr.json
tools/clang-tidy/test/performance-faster-string-find.json
tools/clang-tidy/test/performance-for-range-copy.json
tools/clang-tidy/test/performance-inefficient-string-concatenation.json
tools/clang-tidy/test/performance-inefficient-vector-operation.json
tools/clang-tidy/test/performance-type-promotion-in-math-fn.json
tools/clang-tidy/test/performance-unnecessary-copy-initialization.json
tools/clang-tidy/test/performance-unnecessary-value-param.json
tools/clang-tidy/test/readability-container-size-empty.json
tools/clang-tidy/test/readability-else-after-return.json
tools/clang-tidy/test/readability-misleading-indentation.json
tools/clang-tidy/test/readability-redundant-control-flow.json
tools/clang-tidy/test/readability-redundant-string-cstr.json
tools/clang-tidy/test/readability-redundant-string-init.json
tools/clang-tidy/test/readability-uniqueptr-delete-release.json
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1762,16 +1762,17 @@ class StaticAnalysis(MachCommandBase):
         self.TOOLS_SUCCESS = 0
         self.TOOLS_FAILED_DOWNLOAD = 1
         self.TOOLS_UNSUPORTED_PLATFORM = 2
         self.TOOLS_CHECKER_NO_TEST_FILE = 3
         self.TOOLS_CHECKER_RETURNED_NO_ISSUES = 4
         self.TOOLS_CHECKER_RESULT_FILE_NOT_FOUND = 5
         self.TOOLS_CHECKER_DIFF_FAILED = 6
         self.TOOLS_CHECKER_NOT_FOUND = 7
+        self.TOOLS_CHECKER_LIST_EMPTY = 8
 
         # Configure the tree or download clang-tidy package, depending on the option that we choose
         if intree_tool:
             _, config, _ = self._get_config_environment()
             clang_tools_path = self.topsrcdir
             self._clang_tidy_path = mozpath.join(
                 clang_tools_path, "clang", "bin",
                 "clang-tidy" + config.substs.get('BIN_SUFFIX', ''))
@@ -1819,39 +1820,48 @@ class StaticAnalysis(MachCommandBase):
 
         # List all available checkers
         cmd = [self._clang_tidy_path, '-list-checks', '-checks=*']
         clang_output = subprocess.check_output(
             cmd, stderr=subprocess.STDOUT).decode('utf-8')
         available_checks = clang_output.split('\n')[1:]
         self._clang_tidy_checks = [c.strip() for c in available_checks if c]
 
+        all_checkers = []
+
         # Build the dummy compile_commands.json
         self._compilation_commands_path = self._create_temp_compilation_db(config)
 
         with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
             futures = []
             for item in config['clang_checkers']:
                 # Do not test mozilla specific checks nor the default '-*'
                 if not (item['publish'] and ('restricted-platforms' in item
                                              and platform not in item['restricted-platforms']
                                              or 'restricted-platforms' not in item)
                         and item['name'] not in ['mozilla-*', '-*'] and
                         (checker_names == [] or item['name'] in checker_names)):
                     continue
+                all_checkers.append(item['name'])
                 futures.append(executor.submit(self._verify_checker, item))
 
             for future in concurrent.futures.as_completed(futures):
                 ret_val = future.result()
                 if ret_val != self.TOOLS_SUCCESS:
                     # Also delete the tmp folder
                     shutil.rmtree(self._compilation_commands_path)
                     return ret_val
 
-        self.log(logging.INFO, 'static-analysis', {}, "SUCCESS: clang-tidy all tests passed.")
+        # Run the analysis on all checkers in the same time
+        ret_val = self._verify_all_checkers(all_checkers)
+        if ret_val != self.TOOLS_SUCCESS:
+            return ret_val
+
+        self.log(logging.INFO, 'static-analysis', {},
+                 "SUCCESS: clang-tidy all tests passed.")
         # Also delete the tmp folder
         shutil.rmtree(self._compilation_commands_path)
         return self.TOOLS_SUCCESS
 
     def _create_temp_compilation_db(self, config):
         directory = tempfile.mkdtemp(prefix='cc')
         with open(mozpath.join(directory, "compile_commands.json"), "wb") as file_handler:
             compile_commands = []
@@ -1927,16 +1937,56 @@ class StaticAnalysis(MachCommandBase):
             return rc
 
         if path is None:
             return self._run_clang_format_diff(self._clang_format_diff,
                                                self._clang_format_path, show)
         else:
             return self._run_clang_format_path(self._clang_format_path, show, path)
 
+    def _run_and_return_analysis_result(self, checks, header_filter, sources, jobs=1, fix=False, print_out=False):
+        cmd = self._get_clang_tidy_command(
+            checks=checks, header_filter=header_filter,
+            sources=sources,
+            jobs=jobs, fix=fix)
+
+        clang_output = subprocess.check_output(
+            cmd, stderr=subprocess.STDOUT).decode('utf-8')
+        if print_out:
+            print(clang_output)
+
+        return self._parse_issues(clang_output)
+
+    def _verify_all_checkers(self, items):
+        self.log(logging.INFO, 'static-analysis', {},"RUNNING: clang-tidy checker batch analysis.")
+        if not len(items):
+            self.log(logging.ERROR, 'static-analysis', {}, "ERROR: clang-tidy checker list doesn't is empty!.")
+            return self.TOOLS_CHECKER_LIST_EMPTY
+
+        issues = json.loads(self._run_and_return_analysis_result(
+            checks='-*,' + ",".join(items), header_filter='',
+            sources=[mozpath.join(self._clang_tidy_base_path, "test", checker) + '.cpp' for checker in items], print_out=True))
+
+        for checker in items:
+            test_file_path_json = mozpath.join(self._clang_tidy_base_path, "test", checker) + '.json'
+             # Read the pre-determined issues
+            baseline_issues = self._get_autotest_stored_issues(test_file_path_json)
+
+            #for elements_base in baseline_issues:
+            found = all([element_base in issues for element_base in baseline_issues])
+
+            if not found:
+                self.log(
+                    logging.ERROR, 'static-analysis', {},
+                    "ERROR: clang-tidy auto-test failed for checker {0} in multiple files process unit.".
+                    format(checker))
+                return self.TOOLS_CHECKER_DIFF_FAILED
+
+        return self.TOOLS_SUCCESS
+
     def _verify_checker(self, item):
         check = item['name']
         test_file_path = mozpath.join(self._clang_tidy_base_path, "test", check)
         test_file_path_cpp = test_file_path + '.cpp'
         test_file_path_json = test_file_path + '.json'
 
         self.log(logging.INFO, 'static-analysis', {},"RUNNING: clang-tidy checker {}.".format(check))
 
@@ -1945,26 +1995,21 @@ class StaticAnalysis(MachCommandBase):
             self.log(logging.ERROR, 'static-analysis', {}, "ERROR: clang-tidy checker {} doesn't exist in this clang-tidy version.".format(check))
             return self.TOOLS_CHECKER_NOT_FOUND
 
         # Verify if the test file exists for this checker
         if not os.path.exists(test_file_path_cpp):
             self.log(logging.ERROR, 'static-analysis', {}, "ERROR: clang-tidy checker {} doesn't have a test file.".format(check))
             return self.TOOLS_CHECKER_NO_TEST_FILE
 
-        cmd = self._get_clang_tidy_command(
-            checks='-*,' + check, header_filter='', sources=[test_file_path_cpp], jobs=1, fix=False)
-
-        clang_output = subprocess.check_output(
-            cmd, stderr=subprocess.STDOUT).decode('utf-8')
-
-        issues = self._parse_issues(clang_output)
+        issues = json.loads(self._run_and_return_analysis_result(
+            checks='-*,' + check, header_filter='', sources=[test_file_path_cpp]))
 
         # Verify to see if we got any issues, if not raise exception
-        if not issues:
+        if not len(issues):
             self.log(
                 logging.ERROR, 'static-analysis', {},
                 "ERROR: clang-tidy checker {0} did not find any issues in it\'s associated test suite.".
                 format(check))
             return self.CHECKER_RETURNED_NO_ISSUES
 
         if self._dump_results:
             self._build_autotest_result(test_file_path_json, issues)
@@ -1986,17 +2031,17 @@ class StaticAnalysis(MachCommandBase):
                     logging.ERROR, 'static-analysis', {},
                     "ERROR: clang-tidy auto-test failed for checker {0} Expected: {1} Got: {2}".
                     format(check, baseline_issues, issues))
                 return self.TOOLS_CHECKER_DIFF_FAILED
         return self.TOOLS_SUCCESS
 
     def _build_autotest_result(self, file, issues):
         with open(file, 'w') as f:
-            json.dump(issues, f, indent=4, sort_keys=True)
+            f.write(issues)
 
     def _get_autotest_stored_issues(self, file):
         with open(file) as f:
             return json.load(f)
 
     def _parse_issues(self, clang_output):
         '''
         Parse clang-tidy output into structured issues
--- a/tools/clang-tidy/test/bugprone-suspicious-memset-usage.json
+++ b/tools/clang-tidy/test/bugprone-suspicious-memset-usage.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"memset fill value is char '0', potentially mistaken for int 0\", \"bugprone-suspicious-memset-usage\"], [\"warning\", \"memset fill value is out of unsigned character range, gets truncated\", \"bugprone-suspicious-memset-usage\"], [\"warning\", \"memset of size zero, potentially swapped arguments\", \"bugprone-suspicious-memset-usage\"]]"
\ No newline at end of file
+[["warning", "memset fill value is char '0', potentially mistaken for int 0", "bugprone-suspicious-memset-usage"], ["warning", "memset fill value is out of unsigned character range, gets truncated", "bugprone-suspicious-memset-usage"], ["warning", "memset of size zero, potentially swapped arguments", "bugprone-suspicious-memset-usage"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-cplusplus.NewDelete.json
+++ b/tools/clang-tidy/test/clang-analyzer-cplusplus.NewDelete.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Use of memory after it is freed\", \"clang-analyzer-cplusplus.NewDelete\"], [\"warning\", \"Use of memory after it is freed\", \"clang-analyzer-cplusplus.NewDelete\"], [\"warning\", \"Attempt to free released memory\", \"clang-analyzer-cplusplus.NewDelete\"], [\"warning\", \"Argument to 'delete' is the address of the local variable 'i', which is not memory allocated by 'new'\", \"clang-analyzer-cplusplus.NewDelete\"]]"
\ No newline at end of file
+[["warning", "Use of memory after it is freed", "clang-analyzer-cplusplus.NewDelete"], ["warning", "Use of memory after it is freed", "clang-analyzer-cplusplus.NewDelete"], ["warning", "Attempt to free released memory", "clang-analyzer-cplusplus.NewDelete"], ["warning", "Argument to 'delete' is the address of the local variable 'i', which is not memory allocated by 'new'", "clang-analyzer-cplusplus.NewDelete"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-cplusplus.NewDeleteLeaks.json
+++ b/tools/clang-tidy/test/clang-analyzer-cplusplus.NewDeleteLeaks.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Potential leak of memory pointed to by 'p'\", \"clang-analyzer-cplusplus.NewDeleteLeaks\"]]"
\ No newline at end of file
+[["warning", "Potential leak of memory pointed to by 'p'", "clang-analyzer-cplusplus.NewDeleteLeaks"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-deadcode.DeadStores.json
+++ b/tools/clang-tidy/test/clang-analyzer-deadcode.DeadStores.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Value stored to 'x' is never read\", \"clang-analyzer-deadcode.DeadStores\"]]"
\ No newline at end of file
+[["warning", "Value stored to 'x' is never read", "clang-analyzer-deadcode.DeadStores"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.FloatLoopCounter.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.FloatLoopCounter.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Variable 'x' with floating point type 'float' should not be used as a loop counter\", \"clang-analyzer-security.FloatLoopCounter\"]]"
\ No newline at end of file
+[["warning", "Variable 'x' with floating point type 'float' should not be used as a loop counter", "clang-analyzer-security.FloatLoopCounter"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.UncheckedReturn.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.UncheckedReturn.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"The return value from the call to 'setuid' is not checked.  If an error occurs in 'setuid', the following code may execute with unexpected privileges\", \"clang-analyzer-security.insecureAPI.UncheckedReturn\"]]"
\ No newline at end of file
+[["warning", "The return value from the call to 'setuid' is not checked.  If an error occurs in 'setuid', the following code may execute with unexpected privileges", "clang-analyzer-security.insecureAPI.UncheckedReturn"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.getpw.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.getpw.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid()\", \"clang-analyzer-security.insecureAPI.getpw\"]]"
\ No newline at end of file
+[["warning", "The getpw() function is dangerous as it may overflow the provided buffer. It is obsoleted by getpwuid()", "clang-analyzer-security.insecureAPI.getpw"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mkstemp.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mkstemp.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Call to 'mkstemp' should have at least 6 'X's in the format string to be secure (2 'X's seen)\", \"clang-analyzer-security.insecureAPI.mkstemp\"]]"
\ No newline at end of file
+[["warning", "Call to 'mkstemp' should have at least 6 'X's in the format string to be secure (2 'X's seen)", "clang-analyzer-security.insecureAPI.mkstemp"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mktemp.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.mktemp.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Call to function 'mktemp' is insecure as it always creates or uses insecure temporary file.  Use 'mkstemp' instead\", \"clang-analyzer-security.insecureAPI.mktemp\"]]"
\ No newline at end of file
+[["warning", "Call to function 'mktemp' is insecure as it always creates or uses insecure temporary file.  Use 'mkstemp' instead", "clang-analyzer-security.insecureAPI.mktemp"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.vfork.json
+++ b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.vfork.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process. Replace calls to vfork with calls to the safer 'posix_spawn' function\", \"clang-analyzer-security.insecureAPI.vfork\"]]"
\ No newline at end of file
+[["warning", "Call to function 'vfork' is insecure as it can lead to denial of service situations in the parent process. Replace calls to vfork with calls to the safer 'posix_spawn' function", "clang-analyzer-security.insecureAPI.vfork"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-unix.Malloc.json
+++ b/tools/clang-tidy/test/clang-analyzer-unix.Malloc.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Attempt to free released memory\", \"clang-analyzer-unix.Malloc\"], [\"warning\", \"Use of memory after it is freed\", \"clang-analyzer-unix.Malloc\"], [\"warning\", \"Potential leak of memory pointed to by 'p'\", \"clang-analyzer-unix.Malloc\"], [\"warning\", \"Argument to free() is the address of the local variable 'a', which is not memory allocated by malloc()\", \"clang-analyzer-unix.Malloc\"], [\"warning\", \"Argument to free() is offset by -4 bytes from the start of memory allocated by malloc()\", \"clang-analyzer-unix.Malloc\"]]"
\ No newline at end of file
+[["warning", "Attempt to free released memory", "clang-analyzer-unix.Malloc"], ["warning", "Use of memory after it is freed", "clang-analyzer-unix.Malloc"], ["warning", "Potential leak of memory pointed to by 'p'", "clang-analyzer-unix.Malloc"], ["warning", "Argument to free() is the address of the local variable 'a', which is not memory allocated by malloc()", "clang-analyzer-unix.Malloc"], ["warning", "Argument to free() is offset by -4 bytes from the start of memory allocated by malloc()", "clang-analyzer-unix.Malloc"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-unix.cstring.BadSizeArg.json
+++ b/tools/clang-tidy/test/clang-analyzer-unix.cstring.BadSizeArg.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Potential buffer overflow. Replace with 'sizeof(dest) - strlen(dest) - 1' or use a safer 'strlcat' API\", \"clang-analyzer-unix.cstring.BadSizeArg\"]]"
\ No newline at end of file
+[["warning", "Potential buffer overflow. Replace with 'sizeof(dest) - strlen(dest) - 1' or use a safer 'strlcat' API", "clang-analyzer-unix.cstring.BadSizeArg"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/clang-analyzer-unix.cstring.NullArg.json
+++ b/tools/clang-tidy/test/clang-analyzer-unix.cstring.NullArg.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"Null pointer argument in call to string length function\", \"clang-analyzer-unix.cstring.NullArg\"]]"
\ No newline at end of file
+[["warning", "Null pointer argument in call to string length function", "clang-analyzer-unix.cstring.NullArg"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-argument-comment.json
+++ b/tools/clang-tidy/test/misc-argument-comment.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"argument name 'y' in comment does not match parameter name 'x'\", \"misc-argument-comment\"], [\"warning\", \"argument name 'z' in comment does not match parameter name 'y'\", \"misc-argument-comment\"]]"
\ No newline at end of file
+[["warning", "argument name 'y' in comment does not match parameter name 'x'", "misc-argument-comment"], ["warning", "argument name 'z' in comment does not match parameter name 'y'", "misc-argument-comment"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-assert-side-effect.json
+++ b/tools/clang-tidy/test/misc-assert-side-effect.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"found assert() with side effect\", \"misc-assert-side-effect\"]]"
\ No newline at end of file
+[["warning", "found assert() with side effect", "misc-assert-side-effect"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-bool-pointer-implicit-conversion.json
+++ b/tools/clang-tidy/test/misc-bool-pointer-implicit-conversion.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"dubious check of 'bool *' against 'nullptr', did you mean to dereference it?\", \"misc-bool-pointer-implicit-conversion\"]]"
\ No newline at end of file
+[["warning", "dubious check of 'bool *' against 'nullptr', did you mean to dereference it?", "misc-bool-pointer-implicit-conversion"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-forward-declaration-namespace.json
+++ b/tools/clang-tidy/test/misc-forward-declaration-namespace.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"no definition found for 'A', but a definition with the same name 'A' found in another namespace 'nb'\", \"misc-forward-declaration-namespace\"]]"
\ No newline at end of file
+[["warning", "no definition found for 'A', but a definition with the same name 'A' found in another namespace 'nb'", "misc-forward-declaration-namespace"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-macro-repeated-side-effects.json
+++ b/tools/clang-tidy/test/misc-macro-repeated-side-effects.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"side effects in the 1st macro argument 'x' are repeated in macro expansion\", \"misc-macro-repeated-side-effects\"]]"
\ No newline at end of file
+[["warning", "side effects in the 1st macro argument 'x' are repeated in macro expansion", "misc-macro-repeated-side-effects"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-string-constructor.json
+++ b/tools/clang-tidy/test/misc-string-constructor.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"string constructor parameters are probably swapped; expecting string(count, character)\", \"misc-string-constructor\"], [\"warning\", \"length is bigger then string literal size\", \"misc-string-constructor\"], [\"warning\", \"constructor creating an empty string\", \"misc-string-constructor\"]]"
\ No newline at end of file
+[["warning", "string constructor parameters are probably swapped; expecting string(count, character)", "misc-string-constructor"], ["warning", "length is bigger then string literal size", "misc-string-constructor"], ["warning", "constructor creating an empty string", "misc-string-constructor"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-string-integer-assignment.json
+++ b/tools/clang-tidy/test/misc-string-integer-assignment.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"misc-string-integer-assignment\"], [\"warning\", \"an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility\", \"misc-string-integer-assignment\"]]"
\ No newline at end of file
+[["warning", "an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility", "misc-string-integer-assignment"], ["warning", "an integer is interpreted as a character code when assigning it to a string; if this is intended, cast the integer to the appropriate character type; if you want a string representation, use the appropriate conversion facility", "misc-string-integer-assignment"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-suspicious-missing-comma.json
+++ b/tools/clang-tidy/test/misc-suspicious-missing-comma.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"suspicious string literal, probably missing a comma\", \"misc-suspicious-missing-comma\"]]"
\ No newline at end of file
+[["warning", "suspicious string literal, probably missing a comma", "misc-suspicious-missing-comma"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-suspicious-semicolon.json
+++ b/tools/clang-tidy/test/misc-suspicious-semicolon.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"potentially unintended semicolon\", \"misc-suspicious-semicolon\"]]"
\ No newline at end of file
+[["warning", "potentially unintended semicolon", "misc-suspicious-semicolon"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-swapped-arguments.json
+++ b/tools/clang-tidy/test/misc-swapped-arguments.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.\", \"misc-swapped-arguments\"], [\"warning\", \"argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.\", \"misc-swapped-arguments\"]]"
\ No newline at end of file
+[["warning", "argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.", "misc-swapped-arguments"], ["warning", "argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.", "misc-swapped-arguments"], ["warning", "argument with implicit conversion from 'int' to 'double' followed by argument converted from 'double' to 'int', potentially swapped arguments.", "misc-swapped-arguments"], ["warning", "argument with implicit conversion from 'double' to 'int' followed by argument converted from 'int' to 'double', potentially swapped arguments.", "misc-swapped-arguments"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-unused-alias-decls.json
+++ b/tools/clang-tidy/test/misc-unused-alias-decls.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"namespace alias decl 'n1_unused' is unused\", \"misc-unused-alias-decls\"], [\"warning\", \"namespace alias decl 'n12_unused' is unused\", \"misc-unused-alias-decls\"]]"
\ No newline at end of file
+[["warning", "namespace alias decl 'n1_unused' is unused", "misc-unused-alias-decls"], ["warning", "namespace alias decl 'n12_unused' is unused", "misc-unused-alias-decls"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-unused-raii.json
+++ b/tools/clang-tidy/test/misc-unused-raii.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"object destroyed immediately after creation; did you mean to name the object?\", \"misc-unused-raii\"]]"
\ No newline at end of file
+[["warning", "object destroyed immediately after creation; did you mean to name the object?", "misc-unused-raii"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/misc-unused-using-decls.json
+++ b/tools/clang-tidy/test/misc-unused-using-decls.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"using decl 'C' is unused\", \"misc-unused-using-decls\"]]"
\ No newline at end of file
+[["warning", "using decl 'C' is unused", "misc-unused-using-decls"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-avoid-bind.json
+++ b/tools/clang-tidy/test/modernize-avoid-bind.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"prefer a lambda to std::bind\", \"modernize-avoid-bind\"]]"
\ No newline at end of file
+[["warning", "prefer a lambda to std::bind", "modernize-avoid-bind"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-loop-convert.json
+++ b/tools/clang-tidy/test/modernize-loop-convert.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"use range-based for loop instead\", \"modernize-loop-convert\"]]"
\ No newline at end of file
+[["warning", "use range-based for loop instead", "modernize-loop-convert"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-raw-string-literal.json
+++ b/tools/clang-tidy/test/modernize-raw-string-literal.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"escaped string literal can be written as a raw string literal\", \"modernize-raw-string-literal\"]]"
\ No newline at end of file
+[["warning", "escaped string literal can be written as a raw string literal", "modernize-raw-string-literal"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-shrink-to-fit.json
+++ b/tools/clang-tidy/test/modernize-shrink-to-fit.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"the shrink_to_fit method should be used to reduce the capacity of a shrinkable container\", \"modernize-shrink-to-fit\"], [\"warning\", \"the shrink_to_fit method should be used to reduce the capacity of a shrinkable container\", \"modernize-shrink-to-fit\"]]"
\ No newline at end of file
+[["warning", "the shrink_to_fit method should be used to reduce the capacity of a shrinkable container", "modernize-shrink-to-fit"], ["warning", "the shrink_to_fit method should be used to reduce the capacity of a shrinkable container", "modernize-shrink-to-fit"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-use-bool-literals.json
+++ b/tools/clang-tidy/test/modernize-use-bool-literals.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"converting integer literal to bool, use bool literal instead\", \"modernize-use-bool-literals\"], [\"warning\", \"converting integer literal to bool, use bool literal instead\", \"modernize-use-bool-literals\"], [\"warning\", \"converting integer literal to bool, use bool literal instead\", \"modernize-use-bool-literals\"], [\"warning\", \"converting integer literal to bool, use bool literal instead\", \"modernize-use-bool-literals\"]]"
\ No newline at end of file
+[["warning", "converting integer literal to bool, use bool literal instead", "modernize-use-bool-literals"], ["warning", "converting integer literal to bool, use bool literal instead", "modernize-use-bool-literals"], ["warning", "converting integer literal to bool, use bool literal instead", "modernize-use-bool-literals"], ["warning", "converting integer literal to bool, use bool literal instead", "modernize-use-bool-literals"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-use-equals-default.json
+++ b/tools/clang-tidy/test/modernize-use-equals-default.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"use '= default' to define a trivial default constructor\", \"modernize-use-equals-default\"], [\"warning\", \"use '= default' to define a trivial destructor\", \"modernize-use-equals-default\"]]"
\ No newline at end of file
+[["warning", "use '= default' to define a trivial default constructor", "modernize-use-equals-default"], ["warning", "use '= default' to define a trivial destructor", "modernize-use-equals-default"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-use-equals-delete.json
+++ b/tools/clang-tidy/test/modernize-use-equals-delete.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"use '= delete' to prohibit calling of a special member function\", \"modernize-use-equals-delete\"], [\"warning\", \"use '= delete' to prohibit calling of a special member function\", \"modernize-use-equals-delete\"], [\"warning\", \"use '= delete' to prohibit calling of a special member function\", \"modernize-use-equals-delete\"], [\"warning\", \"use '= delete' to prohibit calling of a special member function\", \"modernize-use-equals-delete\"]]"
\ No newline at end of file
+[["warning", "use '= delete' to prohibit calling of a special member function", "modernize-use-equals-delete"], ["warning", "use '= delete' to prohibit calling of a special member function", "modernize-use-equals-delete"], ["warning", "use '= delete' to prohibit calling of a special member function", "modernize-use-equals-delete"], ["warning", "use '= delete' to prohibit calling of a special member function", "modernize-use-equals-delete"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/modernize-use-nullptr.json
+++ b/tools/clang-tidy/test/modernize-use-nullptr.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"use nullptr\", \"modernize-use-nullptr\"]]"
\ No newline at end of file
+[["warning", "use nullptr", "modernize-use-nullptr"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-faster-string-find.json
+++ b/tools/clang-tidy/test/performance-faster-string-find.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character\", \"performance-faster-string-find\"]]"
\ No newline at end of file
+[["warning", "'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character", "performance-faster-string-find"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-for-range-copy.json
+++ b/tools/clang-tidy/test/performance-for-range-copy.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference\", \"performance-for-range-copy\"]]"
\ No newline at end of file
+[["warning", "the loop variable's type is not a reference type; this creates a copy in each iteration; consider making this a reference", "performance-for-range-copy"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-inefficient-string-concatenation.json
+++ b/tools/clang-tidy/test/performance-inefficient-string-concatenation.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead\", \"performance-inefficient-string-concatenation\"]]"
\ No newline at end of file
+[["warning", "string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead", "performance-inefficient-string-concatenation"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-inefficient-vector-operation.json
+++ b/tools/clang-tidy/test/performance-inefficient-vector-operation.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"'push_back' is called inside a loop; consider pre-allocating the vector capacity before the loop\", \"performance-inefficient-vector-operation\"]]"
\ No newline at end of file
+[["warning", "'push_back' is called inside a loop; consider pre-allocating the vector capacity before the loop", "performance-inefficient-vector-operation"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-type-promotion-in-math-fn.json
+++ b/tools/clang-tidy/test/performance-type-promotion-in-math-fn.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"call to 'acos' promotes float to double\", \"performance-type-promotion-in-math-fn\"]]"
\ No newline at end of file
+[["warning", "call to 'acos' promotes float to double", "performance-type-promotion-in-math-fn"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-unnecessary-copy-initialization.json
+++ b/tools/clang-tidy/test/performance-unnecessary-copy-initialization.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"the const qualified variable 'UnnecessaryCopy' is copy-constructed from a const reference; consider making it a const reference\", \"performance-unnecessary-copy-initialization\"]]"
\ No newline at end of file
+[["warning", "the const qualified variable 'UnnecessaryCopy' is copy-constructed from a const reference; consider making it a const reference", "performance-unnecessary-copy-initialization"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/performance-unnecessary-value-param.json
+++ b/tools/clang-tidy/test/performance-unnecessary-value-param.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"the const qualified parameter 'Value' is copied for each invocation; consider making it a reference\", \"performance-unnecessary-value-param\"]]"
\ No newline at end of file
+[["warning", "the const qualified parameter 'Value' is copied for each invocation; consider making it a reference", "performance-unnecessary-value-param"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-container-size-empty.json
+++ b/tools/clang-tidy/test/readability-container-size-empty.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"the 'empty' method should be used to check for emptiness instead of 'size'\", \"readability-container-size-empty\"]]"
\ No newline at end of file
+[["warning", "the 'empty' method should be used to check for emptiness instead of 'size'", "readability-container-size-empty"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-else-after-return.json
+++ b/tools/clang-tidy/test/readability-else-after-return.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"do not use 'else' after 'return'\", \"readability-else-after-return\"]]"
\ No newline at end of file
+[["warning", "do not use 'else' after 'return'", "readability-else-after-return"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-misleading-indentation.json
+++ b/tools/clang-tidy/test/readability-misleading-indentation.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"different indentation for 'if' and corresponding 'else'\", \"readability-misleading-indentation\"]]"
\ No newline at end of file
+[["warning", "different indentation for 'if' and corresponding 'else'", "readability-misleading-indentation"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-redundant-control-flow.json
+++ b/tools/clang-tidy/test/readability-redundant-control-flow.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"redundant return statement at the end of a function with a void return type\", \"readability-redundant-control-flow\"]]"
\ No newline at end of file
+[["warning", "redundant return statement at the end of a function with a void return type", "readability-redundant-control-flow"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-redundant-string-cstr.json
+++ b/tools/clang-tidy/test/readability-redundant-string-cstr.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"redundant call to 'c_str'\", \"readability-redundant-string-cstr\"]]"
\ No newline at end of file
+[["warning", "redundant call to 'c_str'", "readability-redundant-string-cstr"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-redundant-string-init.json
+++ b/tools/clang-tidy/test/readability-redundant-string-init.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"redundant string initialization\", \"readability-redundant-string-init\"]]"
\ No newline at end of file
+[["warning", "redundant string initialization", "readability-redundant-string-init"]]
\ No newline at end of file
--- a/tools/clang-tidy/test/readability-uniqueptr-delete-release.json
+++ b/tools/clang-tidy/test/readability-uniqueptr-delete-release.json
@@ -1,1 +1,1 @@
-"[[\"warning\", \"prefer '= nullptr' to 'delete x.release()' to reset unique_ptr<> objects\", \"readability-uniqueptr-delete-release\"]]"
\ No newline at end of file
+[["warning", "prefer '= nullptr' to 'delete x.release()' to reset unique_ptr<> objects", "readability-uniqueptr-delete-release"]]
\ No newline at end of file