Unverified Commit 09eb11a1 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[Makefile] Exclude research projects from format (#28551)

parent f4f57f9d
...@@ -5,12 +5,14 @@ export PYTHONPATH = src ...@@ -5,12 +5,14 @@ export PYTHONPATH = src
check_dirs := examples tests src utils check_dirs := examples tests src utils
exclude_folders := examples/research_projects
modified_only_fixup: modified_only_fixup:
$(eval modified_py_files := $(shell python utils/get_modified_files.py $(check_dirs))) $(eval modified_py_files := $(shell python utils/get_modified_files.py $(check_dirs)))
@if test -n "$(modified_py_files)"; then \ @if test -n "$(modified_py_files)"; then \
echo "Checking/fixing $(modified_py_files)"; \ echo "Checking/fixing $(modified_py_files)"; \
ruff check $(modified_py_files) --fix; \ ruff check $(modified_py_files) --fix --exclude $(exclude_folders); \
ruff format $(modified_py_files);\ ruff format $(modified_py_files) --exclude $(exclude_folders);\
else \ else \
echo "No library .py files were modified"; \ echo "No library .py files were modified"; \
fi fi
...@@ -65,8 +67,8 @@ extra_style_checks: ...@@ -65,8 +67,8 @@ extra_style_checks:
# this target runs checks on all files and potentially modifies some of them # this target runs checks on all files and potentially modifies some of them
style: style:
ruff check $(check_dirs) setup.py conftest.py --fix ruff check $(check_dirs) setup.py conftest.py --fix --exclude $(exclude_folders)
ruff format $(check_dirs) setup.py conftest.py ruff format $(check_dirs) setup.py conftest.py --exclude $(exclude_folders)
${MAKE} autogenerate_code ${MAKE} autogenerate_code
${MAKE} extra_style_checks ${MAKE} extra_style_checks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment