diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec968f3..b73d02a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,3 +30,15 @@ jobs: - name: Run Regression Tests run: | make run-regression-tests + + - name: Run Ruff Formatter + uses: chartboost/ruff-action@v1 + with: + src: "./src" + args: "format --check" + + - name: Run Ruff Linter + uses: chartboost/ruff-action@v1 + with: + src: "./src" + args: "check" diff --git a/pyproject.toml b/pyproject.toml index a4ab8ba..ff8ecf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,3 +63,8 @@ modm_data = ["*.md", "*/*.md", "*/*/*.md", "*/*/*/*.md"] [tool.setuptools-git-versioning] version_file = "VERSION" + +[tool.ruff] +exclude = [".venv/", "ext/", "build/", "log/"] +line-length = 120 +target-version = "py311" diff --git a/tools/make/common.mk b/tools/make/common.mk index 164af89..25feaf3 100644 --- a/tools/make/common.mk +++ b/tools/make/common.mk @@ -39,6 +39,13 @@ clean-venv: @rm -rf .venv +.PHONY: format +## Format the Python source code +format: + @ruff format src + @ruff check --fix src + @ruff format src + # =============================== Documentation =============================== .PHONY: build-homepage ## Generate the entire homepage to /docs.