forked from ajslater/codex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint-backend.sh
executable file
·37 lines (34 loc) · 1.04 KB
/
lint-backend.sh
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
#!/bin/bash
# Lint checks
set -euxo pipefail
cd "$(dirname "$0")"
####################
###### Python ######
####################
# Pytest runs flake8, black, isort faster with caching
poetry run pyright
poetry run vulture .
if [ "$(uname)" = "Darwin" ]; then
# Radon is only of interest to development
poetry run radon mi --min B .
fi
############################################
##### Javascript, JSON, Markdown, YAML #####
############################################
npm run lint
npm run check
################################
###### Docker, Shell, Etc ######
################################
if [ "$(uname)" = "Darwin" ]; then
# Hadolint & shfmt are difficult to install on linux
# shellcheck disable=2035
hadolint *.Dockerfile
shfmt -d -i 4 ./*.sh ./**/*.sh
# subdirs aren't copied into docker builder
# .env files aren't copied into docker
shellcheck --external-sources ./**/*.sh .env.platforms .env.pushover
circleci config check .circleci/config.yml
fi
shellcheck --external-sources ./*.sh
poetry run codespell .