<commit_before>#!/bin/sh

set -e

# We currently get one warning when running Python in dev mode:
# astroid/node_classes.py:90: DeprecationWarning: The 'astroid.node_classes' module is deprecated and will be replaced
# by 'astroid.nodes' in astroid 3.0.0
# Turn off dev mode until astroid gets fixed or there's a way to suppress warnings in third party code
#export PYTHONDEVMODE=1

mypy src
pylint --rcfile=../../.pylintrc src tests
python -m flake8 --select=DUO src
pip-audit --strict --progress-spinner=off
safety check --bare --ignore 41002 -r requirements.txt -r requirements-dev.txt  # See https://github.com/nedbat/coveragepy/issues/1200
bandit --quiet --recursive src/
vulture --min-confidence 0 src/ tests/ .vulture_ignore_list.py<commit_msg>add headers to quality.sh (#3067)<commit_after>#!/bin/sh

set -e

# We currently get one warning when running Python in dev mode:
# astroid/node_classes.py:90: DeprecationWarning: The 'astroid.node_classes' module is deprecated and will be replaced
# by 'astroid.nodes' in astroid 3.0.0
# Turn off dev mode until astroid gets fixed or there's a way to suppress warnings in third party code
#export PYTHONDEVMODE=1
HEADER='\033[95m'
ENDSTYLE='\033[0m'

echo "${HEADER}mypy${ENDSTYLE}"
mypy src
echo "${HEADER}pylint${ENDSTYLE}"
pylint --rcfile=../../.pylintrc src tests
echo "${HEADER}flake8${ENDSTYLE}"
python -m flake8 --select=DUO src
echo "${HEADER}pip-audit${ENDSTYLE}"
pip-audit --strict --progress-spinner=off
echo "${HEADER}safety${ENDSTYLE}"
safety check --bare --ignore 41002 -r requirements.txt -r requirements-dev.txt  # See https://github.com/nedbat/coveragepy/issues/1200
echo "${HEADER}bandit${ENDSTYLE}"
bandit --quiet --recursive src/
echo "${HEADER}vulture${ENDSTYLE}"
vulture --min-confidence 0 src/ tests/ .vulture_ignore_list.py
{'fraction_non_alphanumeric': 0.12840466926070038, 'fraction_numerical': 0.02668148971650917, 'mean_word_length': 4.572755417956657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1760517', 'n_tokens_mistral': 650, 'n_tokens_neox': 592, 'n_words': 191}