chore: Add make clean to clean up project directory

1. Add make clean
2. Specify configuration file used by mypy
3. Add some directories to dockerignore

Change-Id: I4f6b0d5ba894214bb0fcff21443f9808f56d595e
This commit is contained in:
Gao Hanxiang 2021-07-22 08:04:27 -04:00 committed by hanxiang gao
parent ee84ba0b8f
commit 8d8c8bd89f
9 changed files with 54 additions and 15 deletions

View File

@ -78,3 +78,7 @@ tmp/
# Remove build context
**/.git
**/tmp
**/.mypy_cache
**/dist
**/node_modules
**/__pycache__

View File

@ -115,6 +115,14 @@ $(TEST_LIBS):
$(MAKE) -C $(basename $@) test
.PHONY: clean $(CLEAN_LIBS)
CLEAN_LIBS := $(addsuffix .clean,$(LIB_PATHS))
clean: $(CLEAN_LIBS)
rm -rf .venv dist
$(CLEAN_LIBS):
$(MAKE) -C $(basename $@) clean
.PHONY: build
BUILD_ENGINE ?= docker
BUILD_CONTEXT ?= .

View File

@ -42,10 +42,10 @@ fmt:
.PHONY: lint
lint:
# poetry run mypy --no-incremental $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
# poetry run mypy --config-file=../../mypy.ini $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run black --check --diff --color --config ../../pyproject.toml $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
.PHONY: test
@ -53,6 +53,11 @@ test:
echo TODO
.PHONY: clean
clean:
rm -rf .venv dist
.PHONY: db_revision
HEAD_REV ?= $(shell poetry run alembic heads | awk '{print $$1}')
NEW_REV ?= $(shell python3 -c 'import sys; print(f"{int(sys.argv[1])+1:03}")' $(HEAD_REV))

View File

@ -30,12 +30,17 @@ fmt:
.PHONY: lint
lint:
poetry run mypy --no-incremental $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run mypy --config-file=../../mypy.ini $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run black --check --diff --color --config ../../pyproject.toml $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
.PHONY: test
test:
echo TODO
.PHONY: clean
clean:
rm -rf .venv dist

View File

@ -30,12 +30,17 @@ fmt:
.PHONY: lint
lint:
poetry run mypy --no-incremental $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run mypy --config-file=../../mypy.ini $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run black --check --diff --color --config ../../pyproject.toml $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
.PHONY: test
test:
echo TODO
.PHONY: clean
clean:
rm -rf .venv dist

View File

@ -30,12 +30,17 @@ fmt:
.PHONY: lint
lint:
poetry run mypy --no-incremental $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run mypy --config-file=../../mypy.ini $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run black --check --diff --color --config ../../pyproject.toml $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
.PHONY: test
test:
echo TODO
.PHONY: clean
clean:
rm -rf .venv dist

View File

@ -31,12 +31,17 @@ fmt:
.PHONY: lint
lint:
poetry run mypy --no-incremental $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run mypy --config-file=../../mypy.ini $$(git ls-files -- **/*.py)
poetry run isort --check-only --diff $$(git ls-files -- **/*.py)
poetry run black --check --diff --color --config ../../pyproject.toml $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
poetry run flake8 $$(git ls-files -- **/*.py)
.PHONY: test
test:
echo TODO
.PHONY: clean
clean:
rm -rf .venv dist

View File

@ -1,4 +1,6 @@
[mypy]
incremental = false
cache_dir = /dev/null
show_error_codes = true
show_error_context = true