-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
57 lines (41 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
PYTHON=python3
.DEFAULT_GOAL := help
SHELL := /bin/bash
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
format: ## Formats the code base and tests using Black.
black --line-length 100 simple_slack_bot tests
isort: ## Orders the imports of the code base and tests using isort.
isort --recursive simple_slack_bot tests
lint: ## Performs linting on the code base and tests using flake8 and pydocstyle.
flake8 simple_slack_bot tests --show-source
# does not check tests to help me keep my sanity as there's many issues that provide little value resolving
pylint simple_slack_bot --ignore=tests
type: ## Checks type hints on the code base and tests using mypy.
mypy simple_slack_bot tests --disallow-untyped-calls
security: ## Checks code base and tests for security vulnerability, bad imports and keys using bandit, safety and dodgy.
# does not check tests to help me keep my sanity as there's many issues that provide little value resolving
bandit -r simple_slack_bot
# ignoring pipenv installed in Circle Ci Docker container
safety check --full-report --ignore 38334
dodgy
magic: format isort lint type security ## Performs format, isort, lint, type and security in that order.
test: ## Runs the pytest suite
pytest
test-and-generate-coverage: ## Runs the pytest suite and generates code coverage.
coverage run -m pytest && coverage report -m
upload-coverage-to-codecov: ## Uploads the covde coverage to Code Cov IO
bash <(curl -s https://codecov.io/bash)
package: ## Packages up the project.
python3 setup.py sdist bdist_wheel
upload-test-pypi: ## Uploads the project to test.pypi.org.
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
upload-pypi: ## Uploads the project to pypi.org
python3 -m twine upload dist/*
example: ## Runs the example component.
python3 example_component.py
circle-ci-validate: ## Validates the circleci config.
circleci config validate
circle-ci-local-execute: ## Execute circleci config locally.
circleci local execute