Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

BUILDTYPE ?= Release
PYTHON ?= python3
RUFF ?= tools/pip/site-packages/bin/ruff
DESTDIR ?=
SIGN ?=
PREFIX ?= /usr/local
Expand Down Expand Up @@ -1694,15 +1695,15 @@ lint-py-build: ## Build resources needed to lint python files.
$(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.13.1

.PHONY: lint-py lint-py-fix lint-py-fix-unsafe
ifneq ("","$(wildcard tools/pip/site-packages/ruff)")
ifneq ("","$(wildcard $(RUFF))")
# Lint the Python code with ruff.
lint-py:
$(info Running Python linter...)
tools/pip/site-packages/bin/ruff check .
$(RUFF) check .
lint-py-fix:
tools/pip/site-packages/bin/ruff check . --fix
$(RUFF) check . --fix
lint-py-fix-unsafe:
tools/pip/site-packages/bin/ruff check . --fix --unsafe-fixes
$(RUFF) check . --fix --unsafe-fixes
else
lint-py lint-py-fix lint-py-fix-unsafe:
$(warning Python linting with ruff is not available)
Expand Down
8 changes: 8 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ pkgs.mkShell {
)
);
}
// (
let
ruff = pkgs.lib.lists.findFirst (p: p.meta.mainProgram == "ruff") null devTools;
in
pkgs.lib.optionalAttrs (ruff != null) {
RUFF = pkgs.lib.getExe ruff;
}
)
// pkgs.lib.optionalAttrs (!withSQLite) {
NOSQLITE = "1";
}
Expand Down
1 change: 1 addition & 0 deletions tools/nix/devTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
pkgs.gh
pkgs.git
pkgs.jq
pkgs.ruff
pkgs.shellcheck
]
++ (
Expand Down
Loading