Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: base project structure #2

Merged
merged 6 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: manage deps and basic commands for development
  • Loading branch information
danfimov committed Sep 17, 2023
commit b8f0d650f8275fdbea1de6ba5b6fc64c60f1edca
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
args := $(wordlist 2, 100, $(MAKECMDGOALS))

APPLICATION_NAME = ya_tacker_client

HELP_FUN = \
%help; while(<>){push@{$$help{$$2//'options'}},[$$1,$$3] \
if/^([\w-_]+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/}; \
print"$$_:\n", map" $$_->[0]".(" "x(20-length($$_->[0])))."$$_->[1]\n",\
@{$$help{$$_}},"\n" for keys %help; \
CODE = ya_tacker_client
TEST = poetry run python3 -m pytest --verbosity=2 --showlocals --log-level=DEBUG

ifndef args
MESSAGE = "No such command (or you pass two or many targets to ). List of possible commands: make help"
else
MESSAGE = "Done"
endif


help: ##@Help Show this help
@echo -e "Usage: make [target] ...\n"
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)

install: ##@Setup Install project requirements
python3 -m pip install poetry
poetry install

test: ##@Testing Test application with pytest
$(TEST)

test-cov: ##@Testing Test application with pytest and create coverage report
$(TEST) --cov=$(APPLICATION_NAME) --cov-report html --cov-fail-under=85

lint: ##@Code Check code with pylint
poetry run python3 -m ruff $(CODE) tests

format: ##@Code Reformat code with ruff and black
poetry run python3 -m ruff $(CODE) tests --fix

clean: ##@Code Clean directory from garbage files
rm -fr *.egg-info dist
Loading