-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
51 lines (35 loc) · 1.24 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
all:lint
lint:lint_markdown lint_python check_data check_source_exist
lint_markdown:
find *.md data/ docs/ | grep '\.md$$' \
| xargs npx markdownlint --config ./.markdownlint.json
POETRY_NO_ROOT:= --no-root
setup_python:
poetry install $(POETRY_OPTION)
lint_python: pyright black flake8 isort yamllint jsonlint pydocstyle lint_cff
pyright:
npx pyright
black:
find ./scripts | grep py$$ | xargs black --diff | diff /dev/null -
flake8:
find ./scripts | grep py$$ | xargs flake8
isort:
find ./scripts | grep py$$ | xargs isort --diff | diff /dev/null -
yamllint:
find . -name '*.yml' -type f | grep -v node_modules | xargs yamllint --no-warnings
jsonlint:
python3 -c "import sys,json;print(json.dumps(\
json.loads(sys.stdin.read()),\
indent=4,ensure_ascii=False,sort_keys=True))" \
< ./.markdownlint.json | diff -q - ./.markdownlint.json
pydocstyle:
pydocstyle ./scripts --ignore=D100,D101,D102,D103,D104,D105,D107,D203,D212,D400,D415
check_data:
find . -name '*.tsv' | xargs python3 scripts/check_data.py
check_source_exist:
python3 scripts/check_source_exist.py \
--source data/rte.lrec2020_sem_short.tsv \
--data data/rte.lrec2020_mlm.tsv \
--op data/operation.rte.lrec2020_mlm.tsv
lint_cff:
cffconvert --validate