Spaces:
Sleeping
Sleeping
Update app.py
Browse filesAdded more logs
app.py
CHANGED
@@ -48,6 +48,7 @@ def run_cppcheck(source_code: str):
|
|
48 |
# choose suffix based on extension
|
49 |
ext = ".c" if source_code.strip().startswith("#include") and ".c" in source_code_name else ".cpp"
|
50 |
tf = NamedTemporaryFile(suffix=ext, delete=False)
|
|
|
51 |
|
52 |
tf.write(source_code.encode())
|
53 |
tf.flush()
|
@@ -64,8 +65,10 @@ def run_cppcheck(source_code: str):
|
|
64 |
# select language/std/profile by extension
|
65 |
if tf.name.endswith(".c"):
|
66 |
lang_args = ["--std=c11", "--language=c", "--profile=misra-c-2012"]
|
|
|
67 |
else:
|
68 |
lang_args = ["--std=c++17", "--language=c++", "--profile=misra-cpp-2012"]
|
|
|
69 |
|
70 |
cmd = ["cppcheck", "--enable=all", *lang_args, "--template=json", tf.name]
|
71 |
|
|
|
48 |
# choose suffix based on extension
|
49 |
ext = ".c" if source_code.strip().startswith("#include") and ".c" in source_code_name else ".cpp"
|
50 |
tf = NamedTemporaryFile(suffix=ext, delete=False)
|
51 |
+
print("ext" + ext)
|
52 |
|
53 |
tf.write(source_code.encode())
|
54 |
tf.flush()
|
|
|
65 |
# select language/std/profile by extension
|
66 |
if tf.name.endswith(".c"):
|
67 |
lang_args = ["--std=c11", "--language=c", "--profile=misra-c-2012"]
|
68 |
+
print("misra-c-2012")
|
69 |
else:
|
70 |
lang_args = ["--std=c++17", "--language=c++", "--profile=misra-cpp-2012"]
|
71 |
+
print("misra-cpp-2012")
|
72 |
|
73 |
cmd = ["cppcheck", "--enable=all", *lang_args, "--template=json", tf.name]
|
74 |
|