Skip to content

Commit

Permalink
refactor: corrects check when trying to create a report; CLI help mes…
Browse files Browse the repository at this point in the history
…sages; typing.

Refs: #204.
  • Loading branch information
Artanias authored Sep 29, 2024
1 parent b77e461 commit 01996c9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UTIL_VERSION := 0.5.5
UTIL_VERSION := 0.5.6
UTIL_NAME := codeplag
PWD := $(shell pwd)

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ lint.ignore = [
"ANN102",
"ANN201",
"ANN204",
"ANN206",
"ANN401", # dynamically typed expressions (typing.Any)
"D100",
"D101",
Expand Down
4 changes: 2 additions & 2 deletions src/codeplag/codeplagcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def __add_report_path(self: Self, subparsers: argparse._SubParsersAction) -> Non
)

report_commands = report.add_subparsers(
help=_("Report commands of the '{util_name}' util.").format(util_name={UTIL_NAME}),
help=_("Report commands of the '{util_name}' util.").format(util_name=UTIL_NAME),
required=True,
metavar="COMMAND",
dest="report",
Expand All @@ -302,7 +302,7 @@ def __add_report_path(self: Self, subparsers: argparse._SubParsersAction) -> Non
"-p",
"--path",
help=_(
"Path to save generated report. " "If it's a directory, then create a file in it."
"Path to save generated report. If it's a directory, then create a file in it."
),
required=True,
type=Path,
Expand Down
2 changes: 1 addition & 1 deletion src/codeplag/handlers/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def html_report_create(report_path: Path, report_type: ReportType) -> Literal[0,
if settings_config["reports_extension"] != "csv":
logger.error("Can create report only when 'reports_extension' is csv.")
return 1
if not reports_path.exists():
if not (reports_path / CSV_REPORT_FILENAME).exists():
logger.error(f"There is nothing in '{reports_path}' to create a basic html report from.")
return 1
create_report_function = _create_report if report_type == "general" else _create_sources_report
Expand Down
2 changes: 1 addition & 1 deletion test/unit/webparsers/test_github_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def raise_for_status(self: Self) -> None:

class TestGitHubParser(unittest.TestCase):
@classmethod
def setUpClass(cls):
def setUpClass(cls: type["TestGitHubParser"]) -> None:
cls.maxDiff = None

def test__is_accepted_extension(self: Self) -> None:
Expand Down

0 comments on commit 01996c9

Please sign in to comment.