Skip to content

Commit

Permalink
add: added thefuzz in the toml file as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Chezka109 committed Oct 24, 2024
2 parents 3b1787e + 3ae3f1e commit eb6ea38
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 241 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@ jobs:
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Execute tests
if: matrix.os != 'windows-latest'
run: poetry run task test

36 changes: 0 additions & 36 deletions .github/workflows/mkdocs.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json

# gatograde.yml files
gatorgrade.yml

# poetry.toml files
poetry.toml
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,5 @@ min-public-methods=2

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
4 changes: 2 additions & 2 deletions gatorgrade/generate/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_targeted_paths_list(
for key in target_path_list:
if key not in targeted_paths_string:
typer.secho(
f"WARNING \u26A0: '{key}' file path is not FOUND!"
f"WARNING \u26a0: '{key}' file path is not FOUND!"
f"\nAll file paths except '{key}' are successfully"
" generated in the 'gatorgrade.yml' file",
fg=typer.colors.YELLOW,
Expand All @@ -90,7 +90,7 @@ def create_targeted_paths_list(
# If all the files exist in the root directory, print out a success message
if targeted_paths:
typer.secho(
"SUCCESS \U0001F525: All the file paths were"
"SUCCESS \U0001f525: All the file paths were"
" successfully generated in the 'gatorgrade.yml' file!",
fg=typer.colors.GREEN,
)
Expand Down
3 changes: 2 additions & 1 deletion gatorgrade/input/checks.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Define check classes."""

from typing import List


class ShellCheck: # pylint: disable=too-few-public-methods
"""Represent a shell check."""

def __init__(self, command: str, description: str = None, json_info=None):
def __init__(self, command: str, description: str = None, json_info=None): # type: ignore
"""Construct a ShellCheck.
Args:
Expand Down
2 changes: 1 addition & 1 deletion gatorgrade/input/command_line_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def generate_checks(
Returns:
A list of ShellChecks and GatorGraderChecks.
"""
checks = []
checks: List[Union[ShellCheck, GatorGraderCheck]] = []
for check_data in check_data_list:
# If the check has a `command` key, then it is a shell check
if "command" in check_data.check:
Expand Down
2 changes: 1 addition & 1 deletion gatorgrade/input/in_file_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def reformat_yaml_data(data):
return reformatted_data


def add_checks_to_list(path, data_list, reformatted_data) -> List[CheckData]:
def add_checks_to_list(path, data_list, reformatted_data):
"""Recursively loop through the data and add checks that are found to the reformatted list."""
current_path = path # Saves the current path to keep track of the location
for ddict in data_list:
Expand Down
7 changes: 6 additions & 1 deletion gatorgrade/output/check_result.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Define check result class."""

from typing import Union
import rich


Expand All @@ -11,7 +12,7 @@ def __init__(
passed: bool,
description: str,
json_info,
path: str = None,
path: Union[str, None] = None,
diagnostic: str = "No diagnostic message available",
):
"""Construct a CheckResult.
Expand All @@ -28,6 +29,7 @@ def __init__(
self.json_info = json_info
self.diagnostic = diagnostic
self.path = path
self.run_command = ""

def display_result(self, show_diagnostic: bool = False) -> str:
"""Print check's passed or failed status, description, and, optionally, diagnostic message.
Expand All @@ -45,6 +47,9 @@ def display_result(self, show_diagnostic: bool = False) -> str:
message += f"\n[yellow] → {self.diagnostic}"
return message

def __repr__(self):
return f"CheckResult(passed={self.passed}, description='{self.description}', json_info={self.json_info}, path='{self.path}', diagnostic='{self.diagnostic}', run_command='{self.run_command}')"

def __str__(self, show_diagnostic: bool = False) -> str:
"""Print check's passed or failed status, description, and, optionally, diagnostic message.
Expand Down
Loading

0 comments on commit eb6ea38

Please sign in to comment.