Compare commits

..

No commits in common. "d5a248733a21b2f5657044b2eb9ff27ae017c165" and "3d882625d28367251fec7293f0384a658717e6b0" have entirely different histories.

5 changed files with 376 additions and 388 deletions

2
.gitignore vendored
View file

@ -3,5 +3,3 @@ site
.venv .venv
.data .data
__pycache__ __pycache__
.mypy_cache/
.ruff_cache/

11
.vscode/settings.json vendored
View file

@ -1,5 +1,6 @@
{ {
"[python]": { "[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll": "explicit" "source.fixAll": "explicit"
}, },
@ -7,15 +8,5 @@
}, },
"[json]": { "[json]": {
"editor.defaultFormatter": "vscode.json-language-features" "editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"editor.formatOnSave": true,
"files.exclude": {
"**/.git": true,
"**/__pycache__": true,
"**/.ruff_cache": true,
"**/.mypy_cache": true
} }
} }

View file

@ -3,8 +3,8 @@ import aiohttp
async def get_status(host: str, port: int = 25565) -> tuple[bool, dict]: async def get_status(host: str, port: int = 25565) -> tuple[bool, dict]:
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(f"https://api.mcsrvstat.us/2/{host}:{port}") as response: async with session.get(f'https://api.mcsrvstat.us/2/{host}:{port}') as response:
response = await response.json() # noqa: PLW2901 response = await response.json()
if response["online"]: if response['online']:
return (True, response) return (True, response)
return (False, response) return (False, response)

View file

@ -84,7 +84,7 @@ target-version = "py311"
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default. # McCabe complexity (`C901`) by default.
select = ["I", "N", "F", "W", "E", "G", "INP", "T20", "PLC", "PLE", "PLW", "PLR", "LOG"] select = ["I", "N", "F", "W", "E", "G", "INP", "T20", "PLC", "PLE", "PLW", "PLR"]
ignore = ["PLR0912", "PLR0915", "PLR2004"] ignore = ["PLR0912", "PLR0915", "PLR2004"]
# Allow fix for all enabled rules (when `--fix`) is provided. # Allow fix for all enabled rules (when `--fix`) is provided.

743
uv.lock generated

File diff suppressed because it is too large Load diff