mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-03 09:49:21 +01:00
Add ruff
to pre-commit
Hooks (#3488)
This commit is contained in:
parent
d48fa71ec5
commit
bbb9fcaaa5
3 changed files with 17 additions and 2 deletions
|
@ -79,3 +79,15 @@ repos:
|
||||||
args:
|
args:
|
||||||
- --diff
|
- --diff
|
||||||
- --check
|
- --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
|
||||||
|
|
|
@ -344,7 +344,7 @@ class TGConstXRefRole(PyXRefRole):
|
||||||
return title, target
|
return title, target
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
sphinx_logger.exception(
|
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.source,
|
||||||
refnode.line,
|
refnode.line,
|
||||||
refnode.rawsource,
|
refnode.rawsource,
|
||||||
|
@ -509,7 +509,7 @@ def _git_branch() -> str:
|
||||||
return output.decode().strip()
|
return output.decode().strip()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
sphinx_logger.exception(
|
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,
|
exc_info=exc,
|
||||||
)
|
)
|
||||||
return "master"
|
return "master"
|
||||||
|
|
|
@ -5,3 +5,6 @@ target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
|
||||||
[tool.isort] # black config
|
[tool.isort] # black config
|
||||||
profile = "black"
|
profile = "black"
|
||||||
line_length = 99
|
line_length = 99
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
line-length = 99
|
||||||
|
|
Loading…
Reference in a new issue