Skip to content

Commit

Permalink
feat: manage deps and basic commands for development
Browse files Browse the repository at this point in the history
  • Loading branch information
danfimov committed Sep 17, 2023
1 parent a314f32 commit b8f0d65
Show file tree
Hide file tree
Showing 3 changed files with 1,282 additions and 0 deletions.
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

0 comments on commit b8f0d65

Please sign in to comment.