Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos committed Jul 11, 2024
1 parent 919bb8b commit 90489a6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,22 +61,22 @@ 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
'UP006', # Non PEP585 annotations
'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]
Expand Down
1 change: 0 additions & 1 deletion src/opower/utilities/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Base class that each utility needs to extend."""


from typing import Any, Optional

import aiohttp
Expand Down
1 change: 1 addition & 0 deletions src/opower/utilities/coautilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""City of Austin Utilities."""

from typing import Optional
from urllib.parse import parse_qs, urlparse

Expand Down
1 change: 1 addition & 0 deletions src/opower/utilities/enmax.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Enmax."""

from typing import Optional
import xml.etree.ElementTree as ET

Expand Down
1 change: 1 addition & 0 deletions tests/opower/utilities/test_smud.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for SMUD."""

import os
import unittest

Expand Down

0 comments on commit 90489a6

Please sign in to comment.