Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Raniz85 committed Sep 15, 2023
1 parent 2a2a4c2 commit a1a2d04
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ruff = "^0.0.289"

[tool.ruff]
select = ["ALL"]
ignore = ["D211", "D213"]
ignore = ["D211", "D213", "T201"]

[tool.ruff.per-file-ignores]
"tests/**" = ["D", "S101", "S105", "INP001", "ANN201"]
Expand Down
2 changes: 1 addition & 1 deletion src/python_starter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""String calculator."""

from .calculator import evaluate
from .calculator import evaluate # noqa: F401
8 changes: 5 additions & 3 deletions src/python_starter/calculator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""String calculator."""
import sys


Expand All @@ -6,6 +7,7 @@ def evaluate(expression: str) -> int:
return 0


def main():
input = " ".join(sys.argv[1:])
print(f"{input} = {evaluate(input)}")
def main() -> None:
"""Calculate the value of a mathematical expression."""
expression = " ".join(sys.argv[1:])
print(f"{expression} = {evaluate(input)}")
9 changes: 4 additions & 5 deletions tests/test_calculator.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import pytest

from python_starter import evaluate


@pytest.mark.parametrize(
"expression, expected",
(
("expression", "expected"),
[
("0", 0),
# ("1 + 2", 3),
# ("1 + 2", 3),
# ("(1 + 2) * 5 / 2 + -3 * 7", -14)
),
],
)
def test_expression(expression, expected):
def test_expression(expression: str, expected: int):
# When the expression is evaluated
result = evaluate(expression)

Expand Down

0 comments on commit a1a2d04

Please sign in to comment.