Skip to content

Commit

Permalink
fix: fixed traceback error
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipOlwoc committed Dec 9, 2024
1 parent 1ff9505 commit 46e3858
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
1 change: 1 addition & 0 deletions gatorgrade/generate/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def write_yaml_of_paths_list(
"description": f"Complete all TODOs in {file_path_fixed}",
"check": "MatchFileFragment",
"options": {"fragment": "TODO", "count": 0, "exact": True},
"motivation": "You're doint Great"
}
]
}
Expand Down
10 changes: 1 addition & 9 deletions gatorgrade/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ def gatorgrade(
3. the name of the file or environment variable\
4. use 'env md GITHUB_STEP_SUMMARY' to create GitHub job summary in GitHub Action",
),
run_status_bar: bool = typer.Option(
False,
"--run_status_bar",
help="Enable a progress bar for checks running/not running.",
),
no_status_bar: bool = typer.Option(
False, "--no_status_bar", help="Disable the progress bar entirely."
),
run_motivation: bool = typer.Option( False, "--motivation", help="Enable a motivational message" ),
):
"""Run the GatorGrader checks in the specified gatorgrade.yml file."""
Expand All @@ -64,7 +56,7 @@ def gatorgrade(
# there are valid checks and thus the
# tool should run them with run_checks
if len(checks) > 0:
checks_status = run_checks(checks, report, run_status_bar, no_status_bar, run_motivation)
checks_status = run_checks(checks, report, )#run_status_bar, #no_status_bar, run_motivation)
# no checks were created and this means
# that, most likely, the file was not
# valid and thus the tool cannot run checks
Expand Down
11 changes: 11 additions & 0 deletions gatorgrade/output/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def _run_gg_check(check: GatorGraderCheck) -> CheckResult:
file_name = check.gg_args[i + 3]
file_path = dir_name + "/" + file_name
break
motivation = ""
if "--motivation" in check.gg_args:
index_of_motivation = check.gg_args.index("--hint")
motivation = check.gg_args[index_of_motivation + 1]
# If arguments are formatted incorrectly, catch the exception and
# return it as the diagnostic message
# Disable pylint to catch any type of exception thrown by GatorGrader
Expand All @@ -90,6 +94,7 @@ def _run_gg_check(check: GatorGraderCheck) -> CheckResult:
json_info=check.json_info,
diagnostic=diagnostic,
path=file_path,
motivation=motivation
)


Expand Down Expand Up @@ -189,6 +194,9 @@ def create_markdown_report_file(json: dict) -> str:
if "file" == i:
val = check["options"]["file"]
markdown_contents += f"\n\t- **file:** {val}"
if "motivation" == i:
val = check["options"]["motivation"]
markdown_contents += f"\n\t- **file:** {val}"
elif "command" in check:
val = check["command"]
markdown_contents += f"\n\t- **command:** {val}"
Expand Down Expand Up @@ -344,6 +352,7 @@ def run_checks(
# and print what ShellCheck command that Gatorgrade ran
if len(failed_results) > 0:
print("\n-~- FAILURES -~-\n")
print("Rebekah Test")
for result in failed_results:
# main.console.print("This is a result")
# main.console.print(result)
Expand All @@ -359,6 +368,8 @@ def run_checks(
rich.print(
f"[blue] → Run this command: [green]{result.run_command}\n"
)
#if result.motivation != "":

# determine how many of the checks passed and then
# compute the total percentage of checks passed
passed_count = len(results) - len(failed_results)
Expand Down
17 changes: 0 additions & 17 deletions gatorgrade/output/quotes.json

This file was deleted.

0 comments on commit 46e3858

Please sign in to comment.