Skip to content

Commit

Permalink
Pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Abelt committed Oct 10, 2023
1 parent ebe572e commit a6b6cb5
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .scripts/generate_patches.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import yaml
import os

begin_revision = '8c976a890eef105d22defbf28f8a5430abec2131'
tags = ['Synthetic', 'compile-time']
project_name = 'SynthCTCRTP'
begin_revision = 'c04c8f975270f73bb64e5295757bf30ef498c20a'
project_name = 'SynthCTTraitBased'

severities = [1,10,100,1000,10000]

store_tags = {"caching-storage":"CachingStoragePolicy","default-storage":"DefaultStoragePolicy","bound-checking-storage":"BoundCheckingStorage","cachable-storage":"CachableStorage", "default-storage":"DefaultStorage", "storage-d":"StorageWithD", "storage-cd":"StorageWithCD", "storage-c":"StorageWithC","null-storage":"NullStorage","storage-c2":"OtherStorageWithC"}
trans_tags = {"default-transformer": "DefaultTransformerPolicy", "smoothing-transformer":"SmoothingTransformerPolicy", "default-algorithm":"DefaultAlgorithm", "direct-solving-algorithm":"DirectSolvingAlgorithm","smoothing-algorithm":"SmoothingAlgorithm", "null-algo":"NullAgorithm", "algo-a":"AlgorithmWithA", "algo-a2":"OtherAlgorithmWithA", "algo-b":"AlgorithmWithB", "algo-ab":"AlgorithmWithAB"}
log_tags = {"dev-null-logger": "DevNullPolicy", "expensive-logger":"ExpensiveLogger", "database-logger": "DataBaseLogger"}

for template in os.listdir(f"../{project_name}"):
if not "%MS%" in template:
continue
Expand All @@ -18,17 +21,25 @@
stem = template.split(".")[0]

name = stem.replace("%MS%", str(s)) + "ms"

info_dict = dict()

info_dict["project_name"] = project_name
info_dict["shortname"] = name
info_dict["shortname"] = name
info_dict["path"] = f"{name}.patch"

parts = name.split('-')

info_dict["description"] = f"Introduces an artificial regression of {parts[-1]} into {parts[-3]} {parts[-2]}."
info_dict["tags"] = ["crtp","compile-time","regression","template",f"{parts[-1]}", "synthetic"]
component_name = "-".join(parts[:-2])

for lookup in [store_tags,trans_tags,log_tags]:
if component_name in lookup:
component_name = lookup[component_name]

print(component_name)

info_dict["description"] = f"Introduces an artificial regression of {parts[-1]} into the {parts[-2]} function of the {component_name} of {project_name}."
info_dict["tags"] = ["compile-time","regression","template",f"{parts[-1]}", "synthetic",component_name,project_name]
revs_dict = dict()
revs_dict["revision_range"] = dict()
revs_dict["revision_range"]["start"] = begin_revision
Expand All @@ -41,5 +52,3 @@

with open(f"../{project_name}/{name}.patch", "w") as patch:
patch.write(patch_content)


0 comments on commit a6b6cb5

Please sign in to comment.