Skip to content

Commit 18edb21

Browse files
SoMEF automatically configures to install the necessary packages
1 parent 77dc0cf commit 18edb21

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/metacheck/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import argparse
22
import os
33
from pathlib import Path
4-
from metacheck.run_somef import run_somef_batch, run_somef_single
4+
from metacheck.run_somef import run_somef_batch, run_somef_single, configure_somef
55
from metacheck.run_analyzer import run_analysis
66

77

@@ -66,6 +66,9 @@ def cli():
6666
run_analysis(somef_json_paths, args.pitfalls_output, args.analysis_output, verbose=args.verbose)
6767

6868
else:
69+
# Before taking any SoMEF actions, configure it
70+
configure_somef()
71+
6972
threshold = args.threshold
7073
somef_output_dir = args.somef_output
7174

src/metacheck/run_somef.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
import json
33
import subprocess
44

5+
def configure_somef():
6+
"""Automatically run 'somef configure -a' if not already configured."""
7+
print("Configuring SoMEF...")
8+
try:
9+
subprocess.run(["somef", "configure", "-a"], check=True)
10+
print("SoMEF configured successfully.")
11+
return True
12+
except subprocess.CalledProcessError as e:
13+
print(f"Error configuring SoMEF: {e}")
14+
return False
15+
516
def run_somef(repo_url, output_file, threshold):
617
"""Run SoMEF on a given repository and save results."""
718
try:

0 commit comments

Comments
 (0)