Skip to content

Commit 8e54b20

Browse files
committed
Added pylint script
1 parent a907ce4 commit 8e54b20

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ exclude = ".*/sdk/.*"
55
[tool.isort]
66
profile = "black"
77
skip_glob = "*/sdk/*"
8+
9+
[tool.pylint]
10+
[tool.pylint.master]
11+
ignore-paths = ".*/sdk"

scripts/check_pylint

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! /bin/bash
2+
3+
ROOT_DIR="$(git rev-parse --show-toplevel)"
4+
source "${ROOT_DIR}/scripts/helpers"
5+
6+
header "Checking code errors with pylint"
7+
8+
if [ -n "$(check_if_installed docker)" ]; then
9+
docker run -v "${PWD}:/code" sergioteula/pytools find . -type f -name '*.py' | xargs pylint --disable=missing-docstring --disable=too-few-public-methods
10+
elif [ -n "$(check_if_installed pylint)" ]; then
11+
find . -type f -name '*.py' | xargs pylint --disable=missing-docstring --disable=too-few-public-methods
12+
else
13+
error "pylint is not installed"
14+
exit 1
15+
fi
16+
17+
EXIT_CODE="$?"
18+
if [ "$EXIT_CODE" = "0" ]; then
19+
success "Code analysis with pylint is correct"
20+
else
21+
error "There are errors detected by pylint"
22+
exit 1
23+
fi

0 commit comments

Comments
 (0)