Reformat code and fix Makefile

This commit is contained in:
Alex Root Junior 2020-01-11 20:01:49 +02:00
parent d2d4f337fb
commit 8726963bc2
3 changed files with 13 additions and 10 deletions

View file

@ -4,6 +4,8 @@ base_python := python3
py := poetry run py := poetry run
python := $(py) python python := $(py) python
reports_dir := reports
.PHONY: help .PHONY: help
help: help:
@echo "=======================================================================================" @echo "======================================================================================="
@ -79,8 +81,8 @@ flake8:
.PHONY: flake8-report .PHONY: flake8-report
flake8-report: flake8-report:
mkdir -p reports/flake8 mkdir -p $(reports_dir)/flake8
$(py) flake8 --format=html --htmldir=reports/flake8 aiogram test $(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 aiogram test
.PHONY: mypy .PHONY: mypy
mypy: mypy:
@ -88,7 +90,7 @@ mypy:
.PHONY: mypy-report .PHONY: mypy-report
mypy-report: mypy-report:
$(py) mypy aiogram tests --html-report reports/typechecking $(py) mypy aiogram tests --html-report $(reports_dir)/typechecking
.PHONY: lint .PHONY: lint
lint: isort black flake8 mypy lint: isort black flake8 mypy
@ -103,9 +105,9 @@ test:
.PHONY: test-coverage .PHONY: test-coverage
test-coverage: test-coverage:
mkdir -p reports/tests/ mkdir -p $(reports_dir)/tests/
$(py) pytest --cov=aiogram --cov-config .coveragerc --html=reports/tests/index.html -p no:warnings tests/ $(py) pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html -p no:warnings tests/
$(py) coverage html -d reports/coverage $(py) coverage html -d $(reports_dir)/coverage
# ================================================================================================= # =================================================================================================
# Docs # Docs
@ -121,7 +123,7 @@ docs-serve:
.PHONY: docs-copy-reports .PHONY: docs-copy-reports
docs-copy-reports: docs-copy-reports:
mv reports/* site/reports mv $(reports_dir)/* site/reports
# ================================================================================================= # =================================================================================================
@ -129,7 +131,7 @@ docs-copy-reports:
# ================================================================================================= # =================================================================================================
.PHONY: build .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 mkdir -p site/simple
poetry build poetry build
mv dist site/simple/aiogram mv dist site/simple/aiogram

View file

@ -1206,7 +1206,7 @@ class Bot(BaseBot):
return await self.emit(call) return await self.emit(call)
async def set_chat_administrator_custom_title( 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: ) -> bool:
""" """
Use this method to set a custom title for an administrator in a supergroup promoted by the 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. :return: Returns True on success.
""" """
call = SetChatAdministratorCustomTitle( 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) return await self.emit(call)

View file

@ -70,6 +70,7 @@ nav:
- api/methods/unban_chat_member.md - api/methods/unban_chat_member.md
- api/methods/restrict_chat_member.md - api/methods/restrict_chat_member.md
- api/methods/promote_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/set_chat_permissions.md
- api/methods/export_chat_invite_link.md - api/methods/export_chat_invite_link.md
- api/methods/set_chat_photo.md - api/methods/set_chat_photo.md