Skip to content

Commit

Permalink
linter autofixes
Browse files Browse the repository at this point in the history
  • Loading branch information
inbalboa committed Jun 16, 2024
1 parent e96b65b commit 67bf142
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
26 changes: 15 additions & 11 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
exclude = ["monobankua/__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 @@ -128,25 +136,21 @@ extend-ignore = [
"RUF001",
]

exclude = ["monobankua/__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"

10 changes: 5 additions & 5 deletions monobankua/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ class ClientInfo:

@dataclass
class Account:
id: str # noqa: A003
id: str
sendId: str # noqa: N815
balance: int
creditLimit: int # noqa: N815
type: str # noqa: A003
type: str
currencyCode: int # noqa: N815
cashbackType: str # noqa: N815
maskedPan: list[str] # noqa: N815
Expand All @@ -108,7 +108,7 @@ def __str__(self):

@dataclass
class Jar:
id: str # noqa: A003
id: str
sendId: str # noqa: N815
title: str
description: str
Expand Down Expand Up @@ -139,7 +139,7 @@ def __str__(self):

@dataclass
class Statement:
id: str # noqa: A003
id: str
time: int
description: str
mcc: int
Expand Down Expand Up @@ -242,7 +242,7 @@ def _get_headers(self, path):
def _make_request(cls, path, method=None, headers=None, body=None):
headers_ = headers or {}
headers_['User-Agent'] = cls.UA
response = requests.request(method or 'GET', cls._get_url(path), headers=headers_, json=body)
response = requests.request(method or 'GET', cls._get_url(path), headers=headers_, json=body, timeout=10)
raw_data = response.json() if response.content else {}
status_code = response.status_code
if status_code != requests.codes.ok:
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@


def long_description():
with Path('README.md').open() as ld:
with Path('README.md').open(encoding='locale') as ld:
return ld.read()


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


def find_version():
with Path('VERSION').open() as ver:
with Path('VERSION').open(encoding='locale') as ver:
return ver.readline().strip()


Expand Down

0 comments on commit 67bf142

Please sign in to comment.