forked from KiCad/kicad-library-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.49 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
58
59
60
SPELLING_PATHS = $(wildcard *.md) docs src common klc-check test tools packages3d symbol-generators
SPELLING_EXCLUDE_FILE = .codespell-excludes
SPELLING_IGNORE_WORDS_FILE = .codespell-ignore-words
SPELLING_SKIP_FILENAMES = .mypy_cache *.csv stm32_generator.py
.PHONY: help
help:
@echo "Supported targets:"
@echo " lint - verify code style"
@echo " spelling - check spelling of text"
@echo " style - apply automatic formatting"
@echo " test-klc-footprints - test footprint KLC rule checks"
@echo " test-klc-symbols - test symbol KLC rule checks"
@echo " check - run all checks and tests"
@echo
.PHONY: lint
lint:
python3 -m flake8 .
.PHONY: spelling
spelling:
codespell \
--exclude-file "$(SPELLING_EXCLUDE_FILE)" \
--ignore-words "$(SPELLING_IGNORE_WORDS_FILE)" \
$(patsubst %, --skip="%",$(SPELLING_SKIP_FILENAMES)) \
$(SPELLING_PATHS)
.PHONY: style
style:
python3 -m isort .
black .
.PHONY: test-klc-footprints
test-klc-footprints:
python3 klc-check/check_footprint.py \
--unittest \
klc-check/test_footprint.pretty/*__*.kicad_mod
python klc-check/check_footprint.py -vv \
klc-check/test_footprint.pretty/SO-8_3.9x4.9mm_P1.27mm.kicad_mod
.PHONY: test-klc-symbols
test-klc-symbols:
python3 klc-check/check_symbol.py \
--unittest \
klc-check/test_symbol/*.kicad_sym
.PHONY: check
check: lint spelling test-klc-footprints test-klc-symbols
.PHONY: install-deps
install-deps:
pip3 install -r requirements.txt