wef
This commit is contained in:
1 parent
089919210b
commit
fcadbacf64
4 files changed
+4
-3
No files matched your search
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# npm run commitlint --edit ${1}
|
||||
@@ -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
|
||||
Reference in new issue
Block a user