Skip to content

Commit

Permalink
crossplane hack, fixed bandit, removed pylint skips
Browse files Browse the repository at this point in the history
  • Loading branch information
c0m4r committed Jan 27, 2024
1 parent a346155 commit eaf941c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions okrutnik.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# --------------------------------------------

# Version
VERSION=2.1.4
VERSION=2.1.5

# Toolset
TOOLSET="bandit black codespell mypy pylint pyright pylama ruff safety"
Expand Down Expand Up @@ -86,6 +86,7 @@ okrutnik_install() {
print "$ARG3"
${PIP} install -r $ARG3
fi
custom_crossplane_hack
echo -e "${CYAN}Receiving communication...${ENDCOLOR}"
echo -e "-> ${GREEN}All your base are belong to us${ENDCOLOR} 👽"
}
Expand Down Expand Up @@ -127,6 +128,16 @@ okrutnik_which_python() {
fi
}

# Custom modules hacks
function custom_crossplane_hack() {
crossplane_path=$(dirname ${VENV}/lib/python*/site-packages)
if [[ -d $crossplane_path ]]; then
echo "Crossplane detected: committing a hack"
touch ${crossplane_path}/site-packages/crossplane/py.typed
sed -i 's/parse(filename,/parse(filename: str,/g;' ${crossplane_path}/site-packages/crossplane/parser.py
fi
}

# --------------------------------------------
# Validation / args handling
# --------------------------------------------
Expand Down Expand Up @@ -214,16 +225,15 @@ mypy --install-types --non-interactive --strict $TARGET ; pass

# pylint
print "pylint (${ITERATION}/${TOOLS_NUM})"
echo "W0718: (broad-exception-caught) is disabled"
pylint --disable W0718 $TARGET ; pass
pylint $TARGET ; pass

# pyright
print "pyright (${ITERATION}/${TOOLS_NUM})"
pyright $TARGET ; pass

# bandit
print "bandit (${ITERATION}/${TOOLS_NUM})"
bandit --quiet $TARGET ; pass
bandit --quiet -r $TARGET ; pass

# --------------------------------------------
# Formatter
Expand Down

0 comments on commit eaf941c

Please sign in to comment.