core: added formatter for changed file

This commit is contained in:
RhodeCode Admin 2025-01-10 10:28:08 +01:00
parent 0003c94632
commit b1fc3e86a5

View file

@ -174,3 +174,17 @@ dev-srv:
ruff-check:
ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
.PHONY: ruff-format
# Get changed Python files
ruff-format:
@echo "Finding changed Python files..."
@git diff --name-only | grep '\.py$$' > .changed_files || true
@if [ -s .changed_files ]; then \
echo "Running Ruff format on the following files:"; \
cat .changed_files; \
cat .changed_files | xargs ruff format; \
else \
echo "No Python files changed."; \
fi
@rm -f .changed_files