diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 861990d95..989e35260 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -79,3 +79,15 @@ repos: args: - --diff - --check +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.212' + hooks: + - id: ruff + name: ruff + files: ^(telegram|examples)/.*\.py$ + additional_dependencies: + - httpx~=0.23.0 + - tornado~=6.2 + - APScheduler~=3.9.1 + - cachetools~=5.2.0 + - aiolimiter~=1.0.0 diff --git a/docs/source/conf.py b/docs/source/conf.py index 9dfb7c2c7..82150ea94 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -344,7 +344,7 @@ class TGConstXRefRole(PyXRefRole): return title, target except Exception as exc: sphinx_logger.exception( - f"%s:%d: WARNING: Did not convert reference %s due to an exception.", + "%s:%d: WARNING: Did not convert reference %s due to an exception.", refnode.source, refnode.line, refnode.rawsource, @@ -509,7 +509,7 @@ def _git_branch() -> str: return output.decode().strip() except Exception as exc: sphinx_logger.exception( - f"Failed to get a description of the current commit. Falling back to `master`.", + "Failed to get a description of the current commit. Falling back to `master`.", exc_info=exc, ) return "master" diff --git a/pyproject.toml b/pyproject.toml index 8b29b136d..348fc3895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,6 @@ target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] [tool.isort] # black config profile = "black" line_length = 99 + +[tool.ruff] +line-length = 99