Skip to content

Commit

Permalink
feat: added version to the command line in main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rebekahrudd committed Nov 22, 2024
1 parent 5ae5e8d commit 74d3913
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions gatorgrade/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
def gatorgrade(
ctx: typer.Context,
filename: Path = typer.Option(FILE, "--config", "-c", help="Name of the yml file."),
version: bool = typer.Option(
DEFAULT_VERSION, "--version", "-v", help="Display version information."
),
report: Tuple[str, str, str] = typer.Option(
(None, None, None),
"--report",
Expand All @@ -58,17 +61,19 @@ def gatorgrade(
# if ctx.subcommand is None then this means
# that, by default, gatorgrade should run in checking mode
if ctx.invoked_subcommand is None:
# parse the provided configuration file
checks = parse_config(filename)
# there are valid checks and thus the
# tool should run them with run_checks
if len(checks) > 0:
checks_status = run_checks(checks, report)
# no checks were created and this means
# that, most likely, the file was not
# valid and thus the tool cannot run checks
# requesting version information overrides all other commands;
# if the version details are requested, print them and exit
# # parse the provided configuration file
# checks = parse_config(filename)
# # there are valid checks and thus the
# # tool should run them with run_checks
# if len(checks) > 0:
# checks_status = run_checks(checks, report)
# # no checks were created and this means
# # that, most likely, the file was not
# # valid and thus the tool cannot run checks
# # requesting version information overrides all other commands;
# # if the version details are requested, print them and exit
# else:
# check_status = False
if version:
# define the version label with suitable emoji
version_label = ":wrench: Version information:"
Expand Down Expand Up @@ -98,7 +103,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)
checks_status = run_checks(checks, report)
# no checks were created and this means
# that, most likely, the file was not
# valid and thus the tool cannot run checks
Expand Down

0 comments on commit 74d3913

Please sign in to comment.