forked from pyspark-ai/pyspark-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (31 loc) · 1.12 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
.PHONY: all format lint test spell_check spell_fix help
# Default target executed when no arguments are given to make.
all: help
test:
poetry run python -u -m unittest discover
######################
# LINTING AND FORMATTING
######################
# Define a variable for Python and notebook files.
PYTHON_FILES='./pyspark_ai'
lint format: PYTHON_FILES='./pyspark_ai'
lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
lint lint_diff:
poetry run black $(PYTHON_FILES) --check
poetry run flake8 $(PYTHON_FILES)
format format_diff:
poetry run black $(PYTHON_FILES)
spell_check:
poetry run codespell --toml pyproject.toml $(PYTHON_FILES)
spell_fix:
poetry run codespell --toml pyproject.toml -w $(PYTHON_FILES)
######################
# HELP
######################
help:
@echo '----'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo 'test - run unit tests'
@echo 'spell_check - run spell check'
@echo 'spell_fix - fix spelling errors'