Skip to content

Commit eaf941c

Browse files
committed
crossplane hack, fixed bandit, removed pylint skips
1 parent a346155 commit eaf941c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

okrutnik.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# --------------------------------------------
2222

2323
# Version
24-
VERSION=2.1.4
24+
VERSION=2.1.5
2525

2626
# Toolset
2727
TOOLSET="bandit black codespell mypy pylint pyright pylama ruff safety"
@@ -86,6 +86,7 @@ okrutnik_install() {
8686
print "$ARG3"
8787
${PIP} install -r $ARG3
8888
fi
89+
custom_crossplane_hack
8990
echo -e "${CYAN}Receiving communication...${ENDCOLOR}"
9091
echo -e "-> ${GREEN}All your base are belong to us${ENDCOLOR} 👽"
9192
}
@@ -127,6 +128,16 @@ okrutnik_which_python() {
127128
fi
128129
}
129130

131+
# Custom modules hacks
132+
function custom_crossplane_hack() {
133+
crossplane_path=$(dirname ${VENV}/lib/python*/site-packages)
134+
if [[ -d $crossplane_path ]]; then
135+
echo "Crossplane detected: committing a hack"
136+
touch ${crossplane_path}/site-packages/crossplane/py.typed
137+
sed -i 's/parse(filename,/parse(filename: str,/g;' ${crossplane_path}/site-packages/crossplane/parser.py
138+
fi
139+
}
140+
130141
# --------------------------------------------
131142
# Validation / args handling
132143
# --------------------------------------------
@@ -214,16 +225,15 @@ mypy --install-types --non-interactive --strict $TARGET ; pass
214225

215226
# pylint
216227
print "pylint (${ITERATION}/${TOOLS_NUM})"
217-
echo "W0718: (broad-exception-caught) is disabled"
218-
pylint --disable W0718 $TARGET ; pass
228+
pylint $TARGET ; pass
219229

220230
# pyright
221231
print "pyright (${ITERATION}/${TOOLS_NUM})"
222232
pyright $TARGET ; pass
223233

224234
# bandit
225235
print "bandit (${ITERATION}/${TOOLS_NUM})"
226-
bandit --quiet $TARGET ; pass
236+
bandit --quiet -r $TARGET ; pass
227237

228238
# --------------------------------------------
229239
# Formatter

0 commit comments

Comments
 (0)