Skip to content

Commit ced0a68

Browse files
Adding the actual changes, previous push did not have any
1 parent a8be09f commit ced0a68

19 files changed

Lines changed: 7319 additions & 246 deletions

src/metacheck/cli.py

Lines changed: 14 additions & 10 deletions
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
4+
from metacheck.run_somef import run_somef_batch, run_somef_single
55
from metacheck.run_analyzer import run_analysis
66

77

@@ -11,7 +11,7 @@ def cli():
1111
"--input",
1212
nargs="+",
1313
required=True,
14-
help="One or more JSON files containing repositories (e.g., GitHub, GitLab) OR existing SoMEF output files when using --skip-somef."
14+
help="One or more: GitHub/GitLab URLs, JSON files containing repositories, OR existing SoMEF output files when using --skip-somef."
1515
)
1616
parser.add_argument(
1717
"--skip-somef",
@@ -58,17 +58,21 @@ def cli():
5858
threshold = args.threshold
5959
somef_output_dir = os.path.join(os.getcwd(), "somef_outputs")
6060

61-
print(f"Detected {len(args.input)} input files:")
62-
for json_path in args.input:
63-
if not os.path.exists(json_path):
64-
print(f"Skipping missing file: {json_path}")
65-
continue
66-
print(f"Processing repositories from {json_path}")
67-
run_somef_batch(json_path, somef_output_dir, threshold)
61+
print(f"Detected {len(args.input)} input(s):")
62+
63+
for input_item in args.input:
64+
if input_item.startswith("http://") or input_item.startswith("https://"):
65+
print(f"Processing repository URL: {input_item}")
66+
run_somef_single(input_item, somef_output_dir, threshold)
67+
elif os.path.exists(input_item):
68+
print(f"Processing repositories from file: {input_item}")
69+
run_somef_batch(input_item, somef_output_dir, threshold)
70+
else:
71+
print(f"Warning: Skipping invalid input (not a URL or existing file): {input_item}")
6872

73+
print(f"\nRunning analysis on outputs in {somef_output_dir}...")
6974
run_analysis(somef_output_dir, args.pitfalls_output, args.analysis_output)
7075

7176

7277
if __name__ == "__main__":
73-
print("!!!THIS IS THE CORRECT TEST VERSION (MSR26) FIXING ONLY W003!!!")
7478
cli()

src/metacheck/detect_pitfalls_main.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from metacheck.scripts.warnings.w008 import detect_author_name_list_warning
3636
from metacheck.scripts.warnings.w009 import detect_development_status_url_pitfall
3737
from metacheck.scripts.warnings.w010 import detect_git_remote_shorthand_pitfall
38-
from metacheck.scripts.warnings.w011 import detect_inconsistent_author_count
3938

4039

4140
def detect_all_pitfalls(json_files: Iterable[Path], pitfalls_output_dir: Union[str, Path], output_file: Union[str, Path]):
@@ -260,13 +259,6 @@ def detect_all_pitfalls(json_files: Iterable[Path], pitfalls_output_dir: Union[s
260259
"count": 0,
261260
"percentage": 0.0,
262261
"languages": {}
263-
},
264-
{
265-
"pitfall_code": "W011",
266-
"pitfall_desc": "The metadata file codeRepository does not have matching number of authors",
267-
"count": 0,
268-
"percentage": 0.0,
269-
"languages": {}
270262
}
271263
]
272264
}
@@ -307,7 +299,6 @@ def detect_all_pitfalls(json_files: Iterable[Path], pitfalls_output_dir: Union[s
307299
(detect_author_name_list_warning, "W008"), # Index 24 -> W008
308300
(detect_development_status_url_pitfall, "W009"), # Index 25 -> W009
309301
(detect_git_remote_shorthand_pitfall, "W010"), # Index 26 -> W010
310-
(detect_inconsistent_author_count, "W011"),
311302
]
312303

313304
for json_file in json_files:

0 commit comments

Comments
 (0)