Skip to content

Commit

Permalink
remove black and isort. use only ruff (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
matin authored Dec 7, 2024
1 parent 7c9a5a7 commit 6a7ee66
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 82 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ sync: .uv

.PHONY: format ## Auto-format python source files
format: .uv
uv run isort $(sources)
uv run black -l 79 $(sources)
uv run ruff format $(sources)
uv run ruff check --fix $(sources)

.PHONY: lint ## Lint python source files
lint: .uv
uv run isort --check-only $(sources)
uv run ruff format --check $(sources)
uv run ruff check $(sources)
uv run black -l 79 $(sources) --check --diff
uv run mypy $(sources)

.PHONY: codespell ## Use Codespell to do spellchecking
Expand Down
1 change: 1 addition & 0 deletions garth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .users import UserProfile, UserSettings
from .version import __version__


__all__ = [
"Client",
"DailyHRV",
Expand Down
1 change: 1 addition & 0 deletions garth/data/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .. import http
from ..utils import date_range, format_end_date


MAX_WORKERS = 10


Expand Down
1 change: 1 addition & 0 deletions garth/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .exc import GarthHTTPError
from .utils import asdict


USER_AGENT = {"User-Agent": "GCM-iOS-5.7.2.1"}


Expand Down
1 change: 1 addition & 0 deletions garth/sso.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from .auth_tokens import OAuth1Token, OAuth2Token
from .exc import GarthException


CSRF_RE = re.compile(r'name="_csrf"\s+value="(.+?)"')
TITLE_RE = re.compile(r"<title>(.+?)</title>")
OAUTH_CONSUMER_URL = "https://thegarth.s3.amazonaws.com/oauth_consumer.json"
Expand Down
1 change: 1 addition & 0 deletions garth/stats/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .. import http
from ..utils import camel_to_snake_dict, format_end_date


BASE_PATH = "/usersummary-service/stats/stress"


Expand Down
1 change: 1 addition & 0 deletions garth/stats/intensity_minutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ._base import Stats


BASE_PATH = "/usersummary-service/stats/im"


Expand Down
1 change: 1 addition & 0 deletions garth/stats/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ._base import Stats


BASE_PATH = "/usersummary-service/stats/steps"


Expand Down
1 change: 1 addition & 0 deletions garth/stats/stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ._base import Stats


BASE_PATH = "/usersummary-service/stats/stress"


Expand Down
1 change: 1 addition & 0 deletions garth/users/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .profile import UserProfile
from .settings import UserSettings


__all__ = ["UserProfile", "UserSettings"]
1 change: 1 addition & 0 deletions garth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import date, datetime, timedelta
from typing import Any, Dict, List, Union


CAMEL_TO_SNAKE = re.compile(
r"((?<=[a-z0-9])[A-Z]|(?!^)[A-Z](?=[a-z])|(?<=[a-zA-Z])[0-9])"
)
Expand Down
28 changes: 19 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ dev = [
"matplotlib",
]
linting = [
"black",
"ruff",
"mypy",
"isort",
"types-requests",
]
testing = [
Expand All @@ -61,10 +59,22 @@ addopts = "--ignore=__pypackages__ --ignore-glob=*.yaml"
[tool.mypy]
ignore_missing_imports = true

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 79
known_first_party = "garth"
[tool.ruff]
line-length = 79
indent-width = 4
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = []

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint.isort]
known-first-party = ["garth"]
combine-as-imports = true
lines-after-imports = 2
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_download(authed_client: Client):
"/download-service/files/activity/11998957007"
)
assert downloaded
zip_magic_number = b"\x50\x4B\x03\x04"
zip_magic_number = b"\x50\x4b\x03\x04"
assert downloaded[:4] == zip_magic_number


Expand Down
68 changes: 0 additions & 68 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a7ee66

Please sign in to comment.