From 32e8dc111821ff62ff650c856a7f02b5eb791954 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 3 Nov 2022 15:23:19 +0100 Subject: [PATCH] Revert "Remove duplicates while merging fixes" This reverts commit f72373ef8dec5bec50f837100febdd8e6efb4797. --- industrial_ci/src/tests/merge_fixes.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/industrial_ci/src/tests/merge_fixes.py b/industrial_ci/src/tests/merge_fixes.py index afba1cda6..73ad4ad94 100755 --- a/industrial_ci/src/tests/merge_fixes.py +++ b/industrial_ci/src/tests/merge_fixes.py @@ -20,13 +20,6 @@ import sys -def key(item): - name = item.get("DiagnosticName") - msg = item.get("DiagnosticMessage") - file = msg.get("FilePath") - offset = msg.get("FileOffset") - return name, file, offset - def merge_fixes(files): """Merge all fixes files into mergefile""" # The fixes suggested by clang-tidy >= 4.0.0 are given under @@ -34,22 +27,13 @@ def merge_fixes(files): mergefile = files[0] mergekey = "Diagnostics" merged = [] - seen = set() # efficiently remember fixes already inserted - - def have(x): - k = key(x) - return k in seen or seen.add(k) - - def unique(seq): - return [x for x in seq if not have(x)] - for file in files: try: with open(file, 'r') as inp: content = yaml.safe_load(inp) if not content: continue # Skip empty files. - merged.extend(unique(content.get(mergekey, []))) + merged.extend(content.get(mergekey, [])) except FileNotFoundError: pass