chore [P-01]: предлинт

This commit is contained in:
Nukeap committed 2025-03-01 18:32:23 +03:00
1 parent 9f1423870d
commit e186c0412b
12 files changed
+191 -3741

No files matched your search

+25 -4
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
docker-compose -f docker-compose.lint.yml run --rm frontendlint
# docker-compose -f docker-compose.lint.yml run --rm frontendlint
# npm run lint-staged
# #
# # Проверяем наличие pylint
@@ -9,15 +9,36 @@ docker-compose -f docker-compose.lint.yml run --rm frontendlint
# exit 1
# fi
# # Получение списка всех Python-файлов, подготовленных для коммита
# files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')
# # Получение списка всех Vue/js/ts-файлов, подготовленных для коммита
filesjs=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.vue$|\.js$|\.ts$'| grep -v 'test\.js$')
filesjs_modified=$(echo "$filesjs" | sed 's|^src/front/src/|./src/|')
echo $filesjs_modified
if [ -n "$filesjs_modified" ]; then
# Запускаем команду formatter в контейнере
docker-compose -f docker-compose.yml run --rm frontend sh -c "npm run formatter --write \"$filesjs_modified\" && npm run linter \"$filesjs_modified\""
fi
# # Получение списка всех Python-файлов, подготовленных для коммита
pyfiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')
pyfiles_mod=$(echo "$pyfiles" | sed 's|^src/back/||'| sed 's|/|.|g; s|\.py$||')
# echo $pyfiles_mod
# exit 1
# # Если нет Python-файлов, выход
# if [ -z "$files" ]; then
# exit 0
# fi
# # Запуск pylint для всех подготовленных Python-файлов
# Запуск pylint для всех подготовленных Python-файлов
# docker-compose -f docker-compose.yml run --rm --entrypoint sh backend -c "poetry run python black \"$pyfiles_mod\" && poetry run python pylint \"$pyfiles_mod\""
# echo 1
# pylint $files
# if [ $? -ne 0 ]; then
# echo "Pylint found issues. Commit aborted."