Skip to content

Commit a9e3cb5

Browse files
committed
Added the ability to lint the code.
1 parent ab47550 commit a9e3cb5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.build
2+
build
3+
dist
4+
.venv
5+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -o pipefail
4+
5+
SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-0}); pwd)
6+
PROJECT_DIR=$(readlink -f "${SCRIPT_DIR}/..")
7+
BUILD_DIR="${PROJECT_DIR}/.build"
8+
LINT_ENV="${BUILD_DIR}/.lint-venv"
9+
LINT_REQUIREMENTS="${PROJECT_DIR}/tests/requirements.txt"
10+
11+
function main() {
12+
if [ ! -d "${LINT_ENV}" ] ; then
13+
mkdir -p "${LINT_ENV}" || exit 1
14+
fi
15+
if [ ! -d "${LINT_ENV}/bin" ] ; then
16+
python3 -m venv "${LINT_ENV}" || exit 1
17+
fi
18+
19+
source "${LINT_ENV}/bin/activate" || exit 1
20+
pip install -r ${LINT_REQUIREMENTS} || exit 1
21+
pip install pylint || exit 1
22+
23+
cd "${PROJECT_DIR}" || exit 1
24+
pylint src
25+
}
26+
27+
main

0 commit comments

Comments
 (0)