Skip to content

Commit

Permalink
some ruff tuning\
Browse files Browse the repository at this point in the history
  • Loading branch information
inbalboa committed Apr 28, 2024
1 parent 37f1bf1 commit accff77
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
26 changes: 15 additions & 11 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
exclude = ["pymstodo/__init__.py"]

fix = true
show-fixes = true
target-version = "py310"
line-length = 120

[lint]
extend-select = [
# pyflakes, pycodestyle
"F", "E", "W",
Expand Down Expand Up @@ -124,25 +132,21 @@ extend-ignore = [
"E501",
]

exclude = ["pymstodo/__init__.py"]

fix = true
show-fixes = true
target-version = "py310"
line-length = 120

[isort]
[lint.isort]
combine-as-imports = true
lines-after-imports = 2

[mccabe]
[lint.mccabe]
max-complexity = 15

[pep8-naming]
[lint.pep8-naming]
extend-ignore-names = ["displayName", "isOwner", "isShared", "wellknownListName", "completedDateTime", "createdDateTime", "dueDateTime", "hasAttachments", "isReminderOn", "lastModifiedDateTime", "reminderDateTime", "startDateTime"]

[flake8-quotes]
[lint.flake8-quotes]
docstring-quotes = "single"
inline-quotes = "single"
multiline-quotes = "single"

[format]
quote-style="preserve"

4 changes: 0 additions & 4 deletions pymstodo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ def get_token(client_id: str, client_secret: str, redirect_resp: str) -> Any:
token_url = f'{ToDoConnection._authority}{ToDoConnection._token_endpoint}'
return oa_sess.fetch_token(token_url, client_secret=client_secret, authorization_response=redirect_resp)


def _refresh_token(self) -> None:
now = time.time()
expire_time = self.token['expires_at'] - 300
Expand Down Expand Up @@ -310,7 +309,6 @@ def get_lists(self, limit: int | None = 99) -> list[TaskList]:
contents = json.loads(resp.content.decode())['value']
return [TaskList(**list_data) for list_data in contents]


def create_list(self, name: str) -> TaskList:
'''Create a new task list
Expand Down Expand Up @@ -436,7 +434,6 @@ def get_tasks(self, list_id: str, limit: int | None = 1000, status: TaskStatusFi
contents = contents[:limit]
return [Task(**task_data) for task_data in contents]


def create_task(self, title: str, list_id: str, due_date: datetime | None = None, body_text: str | None = None) -> Task:
'''Create a new task in a specified task list
Expand Down Expand Up @@ -544,4 +541,3 @@ def complete_task(self, task_id: str, list_id: str) -> Task:
Raises:
PymstodoError: An error occurred accessing the API'''
return self.update_task(task_id, list_id, status='completed')

1 change: 0 additions & 1 deletion pymstodo/windows_zones_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

def get_zoneinfo_name_by_windows_zone(windows_zone: str) -> str:
return windows_zones.get(windows_zone, windows_zone)

2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ def long_description():
with Path('README.md').open() as ld:
return ld.read()


def find_requires():
with Path('requirements.txt').open() as reqs:
return reqs.readlines()


def find_version():
with Path('VERSION').open() as ver:
return ver.readline().strip()
Expand Down

0 comments on commit accff77

Please sign in to comment.