diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c95a673..319391d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -40,7 +40,7 @@ jobs: flake8 . --count --exit-zero --show-source --statistics - name: Lint with ruff run: | - ruff . + ruff check . - name: Static typing with mypy run: | mypy --install-types --non-interactive . diff --git a/README.md b/README.md index 738a0c4..03d49ed 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ pre-commit run --all-files # Alternative: run formatter, lint, and type checking python -m pip install isort black flake8 ruff mypy -isort . ; black . ; flake8 . ; ruff . --fix ; mypy --install-types . +isort . ; black . ; flake8 . ; ruff check . --fix ; mypy --install-types . # Run tests python -m pip install pytest python-dotenv diff --git a/pyproject.toml b/pyproject.toml index f8ddb68..a148a04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ target-version = "py311" exclude = ["*_pb2.py", "*_pb2_grpc.py", "*.pyi"] line-length = 127 -select = [ +lint.select = [ "B007", # Loop control variable {name} not used within loop body "B014", # Exception handler with duplicate exception "C", # complexity @@ -61,7 +61,7 @@ select = [ "W", # pycodestyle ] -ignore = [ +lint.ignore = [ "D203", # 1 blank line required before class docstring "D213", # Multi-line docstring summary should start at the second line # keep-runtime-annotations @@ -69,14 +69,14 @@ ignore = [ 'UP007', # Non PEP604 annotations ] -[tool.ruff.flake8-pytest-style] +[tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Allow for main script to write to stdout "__main__.py" = ["T201"] -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 25 [project.optional-dependencies] diff --git a/src/opower/utilities/base.py b/src/opower/utilities/base.py index 1bea1d0..66aa3b9 100644 --- a/src/opower/utilities/base.py +++ b/src/opower/utilities/base.py @@ -1,6 +1,5 @@ """Base class that each utility needs to extend.""" - from typing import Any, Optional import aiohttp diff --git a/src/opower/utilities/coautilities.py b/src/opower/utilities/coautilities.py index 19e4659..672e7f7 100644 --- a/src/opower/utilities/coautilities.py +++ b/src/opower/utilities/coautilities.py @@ -1,4 +1,5 @@ """City of Austin Utilities.""" + from typing import Optional from urllib.parse import parse_qs, urlparse diff --git a/src/opower/utilities/enmax.py b/src/opower/utilities/enmax.py index 9acaff5..16419b0 100644 --- a/src/opower/utilities/enmax.py +++ b/src/opower/utilities/enmax.py @@ -1,4 +1,5 @@ """Enmax.""" + from typing import Optional import xml.etree.ElementTree as ET diff --git a/tests/opower/utilities/test_smud.py b/tests/opower/utilities/test_smud.py index f8d4446..8fa1c68 100644 --- a/tests/opower/utilities/test_smud.py +++ b/tests/opower/utilities/test_smud.py @@ -1,4 +1,5 @@ """Tests for SMUD.""" + import os import unittest