Skip to content

Commit 0fa1a4b

Browse files
committed
flake8-related updates
1 parent 7576352 commit 0fa1a4b

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

.github/workflows/commit.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ jobs:
2727
python -m pip install flake8 pytest
2828
- name: Lint with flake8
2929
run: |
30-
# stop the build if there are Python syntax errors or undefined names
31-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
30+
flake8 .
3431
- name: Test with pytest
3532
run: |
3633
pytest

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"cSpell.words": [
33
"aiohttp"
4-
]
4+
],
5+
"python.linting.enabled": true,
6+
"python.linting.flake8Enabled": true,
7+
"files.trimTrailingWhitespace": true
58
}

setup.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length=127
3+
max-complexity = 25
4+
doctests = True
5+
noqa-require-code = True

ukrainealarm/client.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ def __init__(self, session: ClientSession, access_token: str):
1515
async def __request(self, method: str, path: str) -> ClientResponse:
1616
"""Make a request."""
1717

18-
headers = {
18+
headers = {
1919
"accept": "application/json",
20-
"authorization": self.access_token
20+
"authorization": self.access_token
2121
}
2222

2323
r = await self.session.request(
24-
method,
25-
f"{Client.BASE_PATH}/{path}",
24+
method,
25+
f"{Client.BASE_PATH}/{path}",
2626
headers=headers,
2727
timeout=Client.REQUEST_TIMEOUT
2828
)
@@ -32,11 +32,11 @@ async def __request(self, method: str, path: str) -> ClientResponse:
3232
async def get_alerts(self, region_id: str = None) -> ClientResponse:
3333
"""Get alerts."""
3434
return await self.__request("GET", "alerts" if region_id is None else f"alerts/{region_id}")
35-
35+
3636
async def get_last_alert_index(self) -> ClientResponse:
3737
"""Get last alert index."""
3838
return await self.__request("GET", "alerts/status")
39-
39+
4040
async def get_regions(self) -> ClientResponse:
4141
"""Get regions."""
4242
return await self.__request("GET", "regions")

0 commit comments

Comments
 (0)