diff --git a/backend/app/controllers/modeus.py b/backend/app/controllers/modeus.py index 0ed1983..9b582fa 100644 --- a/backend/app/controllers/modeus.py +++ b/backend/app/controllers/modeus.py @@ -45,7 +45,9 @@ async def get_modeus_cookies(self, item: FromJson[models.ModeusCreds]) -> Respon @post("/events/") async def get_modeus_events( - self, auth: FromAuthorizationHeader, item: FromJson[models.ModeusSearchEvents] + self, + auth: FromAuthorizationHeader, + item: FromJson[models.ModeusSearchEvents], ) -> Response: """ Get events from Modeus. @@ -54,6 +56,8 @@ async def get_modeus_events( jwt = auth.value.split()[1] return self.json(await modeus.get_events(jwt, item.value)) except IndexError as exception: - return self.json({"error": f"cannot parse authorization header {exception}"}) + return self.json( + {"error": f"cannot parse authorization header {exception}"}, + ) except (RequestException, ModeusError) as exception: return self.json({"error": f"can't authenticate {exception}"}, status=400) diff --git a/backend/app/controllers/netology.py b/backend/app/controllers/netology.py index 36805a4..a13c013 100644 --- a/backend/app/controllers/netology.py +++ b/backend/app/controllers/netology.py @@ -28,7 +28,8 @@ def class_name(cls) -> str: @post() async def get_netology_cookies( - self, item: FromJson[models.NetologyCreds] + self, + item: FromJson[models.NetologyCreds], ) -> Response: """ Auth in Netology and return cookies. diff --git a/backend/app/errors.py b/backend/app/errors.py index b451085..96caa91 100644 --- a/backend/app/errors.py +++ b/backend/app/errors.py @@ -14,7 +14,9 @@ def configure_error_handlers(app: Application) -> None: async def not_found_handler( - app: Application, request: Request, exception: Exception + app: Application, + request: Request, + exception: Exception, ) -> Response: return text(str(exception) or "Not found", 404) @@ -37,5 +39,5 @@ async def accepted(*args: Any) -> Response: UnauthorizedException: unauthorized, ForbiddenException: forbidden, AcceptedException: accepted, - } + }, ) diff --git a/backend/app/templating.py b/backend/app/templating.py index 3ac6efd..82ff61e 100644 --- a/backend/app/templating.py +++ b/backend/app/templating.py @@ -11,7 +11,7 @@ def get_copy(settings: Settings) -> str: """Get copy.""" now = datetime.now() - return "{0} {1}".format(now.year, settings.site.copyright) + return f"{now.year} {settings.site.copyright}" def configure_templating(application: Application, settings: Settings) -> None: diff --git a/backend/integration/modeus.py b/backend/integration/modeus.py index 327e2c6..38c8e0f 100644 --- a/backend/integration/modeus.py +++ b/backend/integration/modeus.py @@ -1,10 +1,8 @@ """Modeus API implementation.""" -from __future__ import annotations - import re from secrets import token_hex -from typing import Any, Dict +from typing import Any import httpx from bs4 import BeautifulSoup, Tag @@ -73,16 +71,21 @@ async def get_auth_form(session: AsyncClient, username: str, password: str) -> T return form -async def login(username: str, __password: str, timeout: int = 15) -> Dict[str, Any]: +async def login(username: str, __password: str, timeout: int = 15) -> dict[str, Any]: """ Log in Modeus. Raises: CannotAuthenticateError: if something changed in API """ - async with httpx.AsyncClient(base_url="https://utmn.modeus.org/", timeout=timeout, headers={ - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0', - }, follow_redirects=True,) as session: + async with httpx.AsyncClient( + base_url="https://utmn.modeus.org/", + timeout=timeout, + headers={ + "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0", + }, + follow_redirects=True, + ) as session: form = await get_auth_form(session, username, __password) auth_data = {} continue_auth_url = "https://auth.modeus.org/commonauth" @@ -113,7 +116,11 @@ def _extract_token_from_url(url: str, match_index: int = 1) -> str | None: return match[match_index] -async def get_events(__jwt: str, body: ModeusSearchEvents, timeout: int = 15) -> list[str] | None: +async def get_events( + __jwt: str, + body: ModeusSearchEvents, + timeout: int = 15, +) -> list[str] | None: """Get events for student in modeus""" session = AsyncClient( http2=True, @@ -122,6 +129,8 @@ async def get_events(__jwt: str, body: ModeusSearchEvents, timeout: int = 15) -> ) session.headers["Authorization"] = f"Bearer {__jwt}" session.headers["content-type"] = "application/json" - response = await session.post("/schedule-calendar-v2/api/calendar/events/search", - content=body.model_dump_json(by_alias=True)) + response = await session.post( + "/schedule-calendar-v2/api/calendar/events/search", + content=body.model_dump_json(by_alias=True), + ) return response.json() diff --git a/backend/poetry.lock b/backend/poetry.lock index ca126d1..85ad22b 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -52,6 +52,20 @@ types-python-dateutil = ">=2.8.10" doc = ["doc8", "sphinx (>=7.0.0)", "sphinx-autobuild", "sphinx-autodoc-typehints", "sphinx_rtd_theme (>=1.3.0)"] test = ["dateparser (==1.*)", "pre-commit", "pytest", "pytest-cov", "pytest-mock", "pytz (==2021.1)", "simplejson (==3.*)"] +[[package]] +name = "astroid" +version = "3.3.4" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.9.0" +files = [ + {file = "astroid-3.3.4-py3-none-any.whl", hash = "sha256:5eba185467253501b62a9f113c263524b4f5d55e1b30456370eed4cdbd6438fd"}, + {file = "astroid-3.3.4.tar.gz", hash = "sha256:e73d0b62dd680a7c07cb2cd0ce3c22570b044dd01bd994bc3a2dd16c6cbba162"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + [[package]] name = "asttokens" version = "2.4.1" @@ -529,6 +543,21 @@ files = [ {file = "deepmerge-1.1.1.tar.gz", hash = "sha256:53a489dc9449636e480a784359ae2aab3191748c920649551c8e378622f0eca4"}, ] +[[package]] +name = "dill" +version = "0.3.8" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, + {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + [[package]] name = "environs" version = "11.0.0" @@ -629,6 +658,81 @@ files = [ [package.extras] tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipython", "littleutils", "pytest", "rich"] +[[package]] +name = "flake8" +version = "7.1.1" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" + +[[package]] +name = "flake8-debugger" +version = "4.1.2" +description = "ipdb/pdb statement checker plugin for flake8" +optional = false +python-versions = ">=3.7" +files = [ + {file = "flake8-debugger-4.1.2.tar.gz", hash = "sha256:52b002560941e36d9bf806fca2523dc7fb8560a295d5f1a6e15ac2ded7a73840"}, + {file = "flake8_debugger-4.1.2-py3-none-any.whl", hash = "sha256:0a5e55aeddcc81da631ad9c8c366e7318998f83ff00985a49e6b3ecf61e571bf"}, +] + +[package.dependencies] +flake8 = ">=3.0" +pycodestyle = "*" + +[[package]] +name = "flake8-docstrings" +version = "1.7.0" +description = "Extension for flake8 which uses pydocstyle to check docstrings" +optional = false +python-versions = ">=3.7" +files = [ + {file = "flake8_docstrings-1.7.0-py2.py3-none-any.whl", hash = "sha256:51f2344026da083fc084166a9353f5082b01f72901df422f74b4d953ae88ac75"}, + {file = "flake8_docstrings-1.7.0.tar.gz", hash = "sha256:4c8cc748dc16e6869728699e5d0d685da9a10b0ea718e090b1ba088e67a941af"}, +] + +[package.dependencies] +flake8 = ">=3" +pydocstyle = ">=2.1" + +[[package]] +name = "flake8-logging" +version = "1.6.0" +description = "A Flake8 plugin that checks for issues using the standard library logging module." +optional = false +python-versions = ">=3.8" +files = [ + {file = "flake8-logging-1.6.0.tar.gz", hash = "sha256:6ad85b386f3e5a65f44ea150dcc878920150813252cded0af7bc41f50be4082d"}, + {file = "flake8_logging-1.6.0-py3-none-any.whl", hash = "sha256:a13c9d1b0fbdece88ccd2b23ce4c83576f843d105f2a5bdf2c086b82f4fe51e2"}, +] + +[package.dependencies] +flake8 = ">=3,<3.2.0 || >3.2.0" + +[[package]] +name = "flake8-print" +version = "5.0.0" +description = "print statement checker plugin for flake8" +optional = false +python-versions = ">=3.7" +files = [ + {file = "flake8-print-5.0.0.tar.gz", hash = "sha256:76915a2a389cc1c0879636c219eb909c38501d3a43cc8dae542081c9ba48bdf9"}, + {file = "flake8_print-5.0.0-py3-none-any.whl", hash = "sha256:84a1a6ea10d7056b804221ac5e62b1cee1aefc897ce16f2e5c42d3046068f5d8"}, +] + +[package.dependencies] +flake8 = ">=3.0" +pycodestyle = "*" + [[package]] name = "guardpost" version = "1.0.2" @@ -841,6 +945,20 @@ qtconsole = ["qtconsole"] test = ["packaging", "pickleshare", "pytest", "pytest-asyncio (<0.22)", "testpath"] test-extra = ["curio", "ipython[test]", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.23)", "pandas", "trio"] +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + [[package]] name = "itsdangerous" version = "2.1.2" @@ -1181,6 +1299,17 @@ files = [ [package.dependencies] traitlets = "*" +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -1315,6 +1444,20 @@ files = [ [package.extras] test = ["Faker (>=1.0.8)", "allpairspy (>=2)", "click (>=6.2)", "pytest (>=6.0.1)", "pytest-discord (>=0.1.2)", "pytest-md-report (>=0.3)"] +[[package]] +name = "pep8-naming" +version = "0.14.1" +description = "Check PEP-8 naming conventions, plugin for flake8" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pep8-naming-0.14.1.tar.gz", hash = "sha256:1ef228ae80875557eb6c1549deafed4dabbf3261cfcafa12f773fe0db9be8a36"}, + {file = "pep8_naming-0.14.1-py3-none-any.whl", hash = "sha256:63f514fc777d715f935faf185dedd679ab99526a7f2f503abb61587877f7b1c5"}, +] + +[package.dependencies] +flake8 = ">=5.0.0" + [[package]] name = "pexpect" version = "4.9.0" @@ -1384,6 +1527,17 @@ files = [ [package.extras] tests = ["pytest"] +[[package]] +name = "pycodestyle" +version = "2.12.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, +] + [[package]] name = "pycparser" version = "2.22" @@ -1410,8 +1564,8 @@ files = [ annotated-types = ">=0.6.0" pydantic-core = "2.23.4" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -1539,6 +1693,34 @@ azure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0 toml = ["tomli (>=2.0.1)"] yaml = ["pyyaml (>=6.0.1)"] +[[package]] +name = "pydocstyle" +version = "6.3.0" +description = "Python docstring style checker" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pydocstyle-6.3.0-py3-none-any.whl", hash = "sha256:118762d452a49d6b05e194ef344a55822987a462831ade91ec5c06fd2169d019"}, + {file = "pydocstyle-6.3.0.tar.gz", hash = "sha256:7ce43f0c0ac87b07494eb9c0b462c0b73e6ff276807f204d6b53edc72b7e44e1"}, +] + +[package.dependencies] +snowballstemmer = ">=2.2.0" + +[package.extras] +toml = ["tomli (>=1.2.3)"] + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pygments" version = "2.18.0" @@ -1570,6 +1752,35 @@ dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pyte docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] +[[package]] +name = "pylint" +version = "3.3.1" +description = "python code static checker" +optional = false +python-versions = ">=3.9.0" +files = [ + {file = "pylint-3.3.1-py3-none-any.whl", hash = "sha256:2f846a466dd023513240bc140ad2dd73bfc080a5d85a710afdb728c420a5a2b9"}, + {file = "pylint-3.3.1.tar.gz", hash = "sha256:9f3dcc87b1203e612b78d91a896407787e708b3f189b5fa0b307712d49ff0c6e"}, +] + +[package.dependencies] +astroid = ">=3.3.4,<=3.4.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, +] +isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + [[package]] name = "pysocks" version = "1.7.1" @@ -1787,6 +1998,33 @@ files = [ {file = "rodi-2.0.6.tar.gz", hash = "sha256:f533e315d84b63824efcc67526a156ad5fb0a158f1ccbc41e0db3944d0c08693"}, ] +[[package]] +name = "ruff" +version = "0.6.7" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.6.7-py3-none-linux_armv6l.whl", hash = "sha256:08277b217534bfdcc2e1377f7f933e1c7957453e8a79764d004e44c40db923f2"}, + {file = "ruff-0.6.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:c6707a32e03b791f4448dc0dce24b636cbcdee4dd5607adc24e5ee73fd86c00a"}, + {file = "ruff-0.6.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:533d66b7774ef224e7cf91506a7dafcc9e8ec7c059263ec46629e54e7b1f90ab"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17a86aac6f915932d259f7bec79173e356165518859f94649d8c50b81ff087e9"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b3f8822defd260ae2460ea3832b24d37d203c3577f48b055590a426a722d50ef"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9ba4efe5c6dbbb58be58dd83feedb83b5e95c00091bf09987b4baf510fee5c99"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:525201b77f94d2b54868f0cbe5edc018e64c22563da6c5c2e5c107a4e85c1c0d"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8854450839f339e1049fdbe15d875384242b8e85d5c6947bb2faad33c651020b"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2f0b62056246234d59cbf2ea66e84812dc9ec4540518e37553513392c171cb18"}, + {file = "ruff-0.6.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b1462fa56c832dc0cea5b4041cfc9c97813505d11cce74ebc6d1aae068de36b"}, + {file = "ruff-0.6.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:02b083770e4cdb1495ed313f5694c62808e71764ec6ee5db84eedd82fd32d8f5"}, + {file = "ruff-0.6.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0c05fd37013de36dfa883a3854fae57b3113aaa8abf5dea79202675991d48624"}, + {file = "ruff-0.6.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f49c9caa28d9bbfac4a637ae10327b3db00f47d038f3fbb2195c4d682e925b14"}, + {file = "ruff-0.6.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a0e1655868164e114ba43a908fd2d64a271a23660195017c17691fb6355d59bb"}, + {file = "ruff-0.6.7-py3-none-win32.whl", hash = "sha256:a939ca435b49f6966a7dd64b765c9df16f1faed0ca3b6f16acdf7731969deb35"}, + {file = "ruff-0.6.7-py3-none-win_amd64.whl", hash = "sha256:590445eec5653f36248584579c06252ad2e110a5d1f32db5420de35fb0e1c977"}, + {file = "ruff-0.6.7-py3-none-win_arm64.whl", hash = "sha256:b28f0d5e2f771c1fe3c7a45d3f53916fc74a480698c4b5731f0bea61e52137c8"}, + {file = "ruff-0.6.7.tar.gz", hash = "sha256:44e52129d82266fa59b587e2cd74def5637b730a69c4542525dfdecfaae38bd5"}, +] + [[package]] name = "selenium" version = "4.25.0" @@ -1828,6 +2066,17 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + [[package]] name = "sortedcontainers" version = "2.4.0" @@ -1891,6 +2140,17 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, + {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, +] + [[package]] name = "traitlets" version = "5.14.3" @@ -2178,4 +2438,4 @@ h11 = ">=0.9.0,<1" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "b8f7733407f1c6392175f7e51a7d597de1e04f8c723ac59f24514a6c42e71357" +content-hash = "1a66d6cf6066370ee6de77740b41f2bc937964a020c9d56ffccdc77ccd84698b" diff --git a/backend/pyproject.toml b/backend/pyproject.toml index dd26046..86dfee5 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -27,6 +27,15 @@ black = "^24.8.0" lxml = "^5.3.0" python-multipart = "^0.0.10" pyyaml = "^6.0.2" +flake8-docstrings = "^1.7.0" +ruff = "^0.6.7" +pyflakes = "^3.2.0" +pycodestyle = "^2.12.1" +flake8-debugger = "^4.1.2" +flake8-logging = "^1.6.0" +flake8-print = "^5.0.0" +pep8-naming = "^0.14.1" +pylint = "^3.3.1" [tool.poetry.group.dev.dependencies] @@ -50,4 +59,34 @@ show_error_codes = true implicit_reexport = true allow_untyped_decorators = true warn_return_any = false -warn_no_return = false \ No newline at end of file +warn_no_return = false + +[tool.ruff] +lint.select = [ + "A", # prevent using keywords that clobber python builtins + "N", # pep8-naming + "B", # bugbear: security warnings + "E", # pycodestyle + "F", # pyflakes + "ISC", # implicit string concatenation + "UP", # alert you when better syntax is available in your python version + "RUF", # the ruff developer's own rules + + "T20", # flake8-print + "T10", # flake8-debugger + "LOG", # flake8-logging + "COM", # flake8-logging + "ASYNC", # flake8-async + "ANN", # flake8-annotations + "PL", # Pylint +] +line-length = 119 +lint.ignore = [ + "ANN101", + "ANN401", + "ANN102" +] + +[tool.ruff.format] +docstring-code-format = true +docstring-code-line-length = 119 diff --git a/backend/setup.cfg b/backend/setup.cfg index dee8a84..3d23b32 100644 --- a/backend/setup.cfg +++ b/backend/setup.cfg @@ -2,6 +2,9 @@ # Base flake8 configuration: # https://flake8.pycqa.org/en/latest/user/configuration.html + + + # format = wemake statistics = False doctests = True