mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Reformat code and fix Makefile
This commit is contained in:
parent
d2d4f337fb
commit
8726963bc2
3 changed files with 13 additions and 10 deletions
18
Makefile
18
Makefile
|
|
@ -4,6 +4,8 @@ base_python := python3
|
|||
py := poetry run
|
||||
python := $(py) python
|
||||
|
||||
reports_dir := reports
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "======================================================================================="
|
||||
|
|
@ -79,8 +81,8 @@ flake8:
|
|||
|
||||
.PHONY: flake8-report
|
||||
flake8-report:
|
||||
mkdir -p reports/flake8
|
||||
$(py) flake8 --format=html --htmldir=reports/flake8 aiogram test
|
||||
mkdir -p $(reports_dir)/flake8
|
||||
$(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 aiogram test
|
||||
|
||||
.PHONY: mypy
|
||||
mypy:
|
||||
|
|
@ -88,7 +90,7 @@ mypy:
|
|||
|
||||
.PHONY: mypy-report
|
||||
mypy-report:
|
||||
$(py) mypy aiogram tests --html-report reports/typechecking
|
||||
$(py) mypy aiogram tests --html-report $(reports_dir)/typechecking
|
||||
|
||||
.PHONY: lint
|
||||
lint: isort black flake8 mypy
|
||||
|
|
@ -103,9 +105,9 @@ test:
|
|||
|
||||
.PHONY: test-coverage
|
||||
test-coverage:
|
||||
mkdir -p reports/tests/
|
||||
$(py) pytest --cov=aiogram --cov-config .coveragerc --html=reports/tests/index.html -p no:warnings tests/
|
||||
$(py) coverage html -d reports/coverage
|
||||
mkdir -p $(reports_dir)/tests/
|
||||
$(py) pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html -p no:warnings tests/
|
||||
$(py) coverage html -d $(reports_dir)/coverage
|
||||
|
||||
# =================================================================================================
|
||||
# Docs
|
||||
|
|
@ -121,7 +123,7 @@ docs-serve:
|
|||
|
||||
.PHONY: docs-copy-reports
|
||||
docs-copy-reports:
|
||||
mv reports/* site/reports
|
||||
mv $(reports_dir)/* site/reports
|
||||
|
||||
|
||||
# =================================================================================================
|
||||
|
|
@ -129,7 +131,7 @@ docs-copy-reports:
|
|||
# =================================================================================================
|
||||
|
||||
.PHONY: build
|
||||
build: clean tests test-coverage flake8-report mypy-report docs docs-copy-reports
|
||||
build: clean flake8-report mypy-report test-coverage docs docs-copy-reports
|
||||
mkdir -p site/simple
|
||||
poetry build
|
||||
mv dist site/simple/aiogram
|
||||
|
|
|
|||
|
|
@ -1206,7 +1206,7 @@ class Bot(BaseBot):
|
|||
return await self.emit(call)
|
||||
|
||||
async def set_chat_administrator_custom_title(
|
||||
self, chat_id: Union[int, str], user_id: int, custom_title: str,
|
||||
self, chat_id: Union[int, str], user_id: int, custom_title: str
|
||||
) -> bool:
|
||||
"""
|
||||
Use this method to set a custom title for an administrator in a supergroup promoted by the
|
||||
|
|
@ -1222,7 +1222,7 @@ class Bot(BaseBot):
|
|||
:return: Returns True on success.
|
||||
"""
|
||||
call = SetChatAdministratorCustomTitle(
|
||||
chat_id=chat_id, user_id=user_id, custom_title=custom_title,
|
||||
chat_id=chat_id, user_id=user_id, custom_title=custom_title
|
||||
)
|
||||
return await self.emit(call)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ nav:
|
|||
- api/methods/unban_chat_member.md
|
||||
- api/methods/restrict_chat_member.md
|
||||
- api/methods/promote_chat_member.md
|
||||
- api/methods/set_chat_administrator_custom_title.md
|
||||
- api/methods/set_chat_permissions.md
|
||||
- api/methods/export_chat_invite_link.md
|
||||
- api/methods/set_chat_photo.md
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue