mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Update CI and pre-commit
This commit is contained in:
parent
4184280d4e
commit
3f2887d67f
7
.github/workflows/python-lint.yml
vendored
7
.github/workflows/python-lint.yml
vendored
@ -6,16 +6,17 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
python-version: "3.12"
|
||||
- uses: isort/isort-action@master
|
||||
with:
|
||||
sortPaths: "./maubot"
|
||||
- uses: psf/black@stable
|
||||
with:
|
||||
src: "./maubot"
|
||||
version: "24.2.0"
|
||||
- name: pre-commit
|
||||
run: |
|
||||
pip install pre-commit
|
||||
|
@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude_types: [markdown]
|
||||
@ -8,13 +8,13 @@ repos:
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
rev: 24.2.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
files: ^maubot/.*\.pyi?$
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
- id: isort
|
||||
files: ^maubot/.*\.pyi?$
|
||||
|
@ -1,3 +1,3 @@
|
||||
pre-commit>=2.10.1,<3
|
||||
isort>=5.10.1,<6
|
||||
black>=23,<24
|
||||
black>=24,<25
|
||||
|
@ -56,9 +56,11 @@ async def get_table(request: web.Request) -> web.Response:
|
||||
try:
|
||||
order = [tuple(order.split(":")) for order in request.query.getall("order")]
|
||||
order = [
|
||||
(asc if sort.lower() == "asc" else desc)(table.columns[column])
|
||||
if sort
|
||||
else table.columns[column]
|
||||
(
|
||||
(asc if sort.lower() == "asc" else desc)(table.columns[column])
|
||||
if sort
|
||||
else table.columns[column]
|
||||
)
|
||||
for column, sort in order
|
||||
]
|
||||
except KeyError:
|
||||
|
@ -9,5 +9,5 @@ skip = ["maubot/management/frontend"]
|
||||
|
||||
[tool.black]
|
||||
line-length = 99
|
||||
target-version = ["py38"]
|
||||
target-version = ["py310"]
|
||||
force-exclude = "maubot/management/frontend"
|
||||
|
Loading…
Reference in New Issue
Block a user