Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· OpenAIAi2 WildChat-4.8M (AI2)

ifeq ($(shell test -e '.env' && echo -n yes),yes) include .env endif Manually define…

  1. User

    ifeq ($(shell test -e '.env' && echo -n yes),yes) include .env endif

    Manually define main variables

    ifndef APP_PORT override APP_PORT = 8000 endif

    ifndef APP_HOST override APP_HOST = 127.0.0.1 endif

    parse additional args for commands

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

    APPLICATION_NAME = shortener TEST = poetry run python -m pytest --verbosity=2 --showlocals --log-level=DEBUG CODE = $(APPLICATION_NAME) tests

    HELP_FUN =
    %help; while(<>){push@{help{2//'options'}},[1,1,3]
    if/^([\w-]+)\s*:.##(?:@(\w+))?\s(.)/}; \ print":\n", map" −>[0]".(""x(20−length(_->[0]".(" "x(20-length(->[0])))."_->[1]\n",\ @{help{$$}},"\n" for keys %help; \

    Commands

    env: ##@Environment Create .env file with variables @$(eval SHELL:=/bin/bash) @cp .env.example .env

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

    db: ##@Database Create database with docker-compose docker-compose -f docker-compose.yml up -d --remove-orphans

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

    format: ##@Code Reformat code with isort and black poetry run python3 -m isort (CODE)poetryrunpython3−mblack(CODE) poetry run python3 -m black (CODE)

    migrate: ##@Database Do all migrations in database cd (APPLICATION_NAME)/db && alembic upgrade (args)

    run: ##@Application Run application server poetry run python3 -m $(APPLICATION_NAME)

    revision: ##@Database Create new revision file automatically with prefix (ex. 2022_01_01_14cs34f_message.py) cd $(APPLICATION_NAME)/db && alembic revision --autogenerate

    open_db: ##@Database Open database inside docker-image docker exec -it shortener_postgres psql -d (POSTGRESDB)−U(POSTGRES_DB) -U (POSTGRES_USER)

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

    test-cov: ##@Testing Test application with pytest and create coverage report make db && (TEST)−−cov=(TEST) --cov=(APPLICATION_NAME) --cov-report html --cov-fail-under=70

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

    %:: echo $(MESSAGE) здесь есть ошибки?

  2. Assistant

    No, there are no errors in this Makefile.