-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The logic of some of the scripts under "./scripts/" has been moved to the new Makefile. This improves the developer experience since this Makefile provides all the commands a developer needs to write code in this repo. Apart from that, this commit also fixes the last lint issues, so now the linter returns a 10/10 score.
- Loading branch information
1 parent
9f47365
commit fc70039
Showing
14 changed files
with
75 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
SRC_DIR := ./generic_k8s_webhook | ||
TEST_DIR := ./tests | ||
SRC_FILES := $(shell find $(SRC_DIR) -type f -name '*.py') | ||
TEST_FILES := $(shell find $(TEST_DIR) -type f -name '*.py') | ||
|
||
out/install-deps.stamp: pyproject.toml poetry.lock | ||
poetry install | ||
mkdir -p out | ||
touch out/install-deps.stamp | ||
|
||
install-deps: out/install-deps.stamp | ||
|
||
out/build.stamp: install-deps $(SRC_FILES) $(TEST_FILES) | ||
poetry build | ||
touch out/build.stamp | ||
|
||
build: out/build.stamp | ||
|
||
.PHONY: lint | ||
lint: build | ||
poetry run isort $(SRC_DIR) $(TEST_DIR) -c | ||
poetry run black $(SRC_DIR) $(TEST_DIR) --check | ||
poetry run pylint $(SRC_DIR) -v | ||
|
||
.PHONY: format | ||
format: build | ||
poetry run isort $(SRC_DIR) $(TEST_DIR) | ||
poetry run black $(SRC_DIR) $(TEST_DIR) | ||
|
||
.PHONY: unittests | ||
unittests: build | ||
poetry run pytest tests --timeout 15 | ||
|
||
.PHONY: check-pyproject | ||
check-pyproject: | ||
echo "Check the pyproject.toml has 'version = \"0.0.0\"'" | ||
grep 'version = "0.0.0"' pyproject.toml | ||
|
||
.PHONY: docker | ||
docker: | ||
docker build -t generic-k8s-webhook:latest . | ||
|
||
all-tests: check-pyproject lint unittests docker | ||
|
||
all-tests-seq: | check-pyproject lint unittests docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.