This commit is contained in:
Nukeap committed 2025-02-14 13:16:30 +03:00
1 parent 089919210b
commit fcadbacf64
4 files changed
+4 -3

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
# npm run commitlint --edit ${1}
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env sh
# docker-compose run --rm frontend npx lint-staged
npm run lint-staged
#
# Проверяем наличие pylint
if ! [ -x "$(command -v pylint)" ]; then
echo 'Error: pylint is not installed.' >&2
exit 1
fi
# Получение списка всех Python-файлов, подготовленных для коммита
files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')
# Если нет Python-файлов, выход
if [ -z "$files" ]; then
exit 0
fi
# Запуск pylint для всех подготовленных Python-файлов
pylint $files
if [ $? -ne 0 ]; then
echo "Pylint found issues. Commit aborted."
exit 1
fi