From 2731dbf9958bee653d6ea32b8576a8942952845f Mon Sep 17 00:00:00 2001 From: Enzo Nunes Date: Tue, 25 Feb 2025 11:39:13 +0000 Subject: [PATCH] remove test. fix if clause structure. --- PICable.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PICable.py b/PICable.py index df211bd..d233233 100644 --- a/PICable.py +++ b/PICable.py @@ -52,9 +52,12 @@ def get_lines_of_code(owner, repository): try: subprocess.run( - ["git", "clone", repo_url, repository_clone_dir], check=True, stdout=sys.stdout, stderr=sys.stderr + ["git", "clone", repo_url, repository_clone_dir], + check=True, + stdout=sys.stdout, + stderr=sys.stderr, ) - except: + except Exception: return -1 result = subprocess.run(["sloccount", repository_clone_dir], capture_output=True, text=True, check=True) @@ -126,12 +129,9 @@ def PICable(owner, repository, token): or lines_of_code < LIMIT_NLOC * (1 - MARGIN) ): picable_report += f"The repository {repository_url} is not PICable. :x:\nThere is at least one requirement which is more than {margin_percentage}% below the requirement.\n" - elif all([stars >= LIMIT_STARS, commits_30_days >= LIMIT_COMMITS_30_DAYS, lines_of_code >= LIMIT_NLOC]): + elif stars >= LIMIT_STARS and commits_30_days >= LIMIT_COMMITS_30_DAYS and lines_of_code >= LIMIT_NLOC: picable_report += f"The repository {repository_url} is PICable. :white_check_mark:\n" else: picable_report += f"The repository {repository_url} is almost PICable. :warning:\nThere is at least one requirement which is below the requirement, but by less than {margin_percentage}%. Consult with a professor before proceeding.\n" return picable_report - - -print(PICable("numpy", "numpy", "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"))