Skip to content

Commit d53bdf1

Browse files
committed
Update makefile
1 parent 9c8b7dc commit d53bdf1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PYTHON = python3
2121

2222
# .PHONY defines parts of the makefile that are not dependant on any specific file
2323
# This is most often used to store functions
24-
.PHONY = all help setup format lint test-n-cover
24+
.PHONY = all help setup format lint format-n-lint test-n-cover pre-commit
2525

2626
# Defining an array variable
2727
FILES = input output
@@ -37,7 +37,9 @@ help:
3737
@echo "$(BOLD_CYAN)make setup$(RESET_STYLES) : Setup pyflask-service"
3838
@echo "$(BOLD_CYAN)make format$(RESET_STYLES) : Format and fix python code in pyflask-service"
3939
@echo "$(BOLD_CYAN)make lint$(RESET_STYLES) : Lint pyflask-service"
40+
@echo "$(BOLD_CYAN)make format-n-lint$(RESET_STYLES) : Format and lint python code in pyflask-service"
4041
@echo "$(BOLD_CYAN)make test-n-cover$(RESET_STYLES) : Test and code coverage pyflask-service"
42+
@echo "$(BOLD_CYAN)make pre-commit$(RESET_STYLES) : Run pre-commit checks for pyflask-service"
4143
@echo "$(BOLD_CYAN)make debug$(RESET_STYLES) : Debug pyflask-service"
4244
@echo "$(BOLD_CYAN)make clean$(RESET_STYLES) : Clean pyflask-service"
4345
@echo "$(BOLD_CYAN)make dev-run$(RESET_STYLES) : Run pyflask-service in environment=development"
@@ -95,9 +97,21 @@ lint: #: Run static analysis with flake8, radon, mypy and bandit
9597
@echo "\n"
9698

9799

100+
format-n-lint: #: Format and lint
101+
make format
102+
make lint
103+
@echo "\n"
104+
105+
98106
test-n-cover: #: Test with pytest, Code coverage with pytest-cov plugin
99107
@echo "\n$(BOLD_CYAN)Testing with pytest$(RESET_STYLES) 📊️"
100108
pytest --version
101109
pytest
102110
@echo "\n"
103111

112+
113+
pre-commit: #: Run pre-commit checks : format, lint, test, cover
114+
make format-n-lint
115+
make test-n-cover
116+
@echo "\n$(BOLD_CYAN)Pre commit jobs completed$(RESET_STYLES) 👍"
117+
@echo "\n"

0 commit comments

Comments
 (0)