From 3514d183e9168eff5b39af5fc7745e7a593b7432 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Fri, 31 Jan 2025 11:48:04 +0100 Subject: [PATCH 1/2] chore: Add make fix for running cargo fix + clippy --fix --- Makefile | 7 +++++++ crates/Makefile | 4 ++++ py-polars/Makefile | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 534e14076b73..8dcd81819b61 100644 --- a/Makefile +++ b/Makefile @@ -137,6 +137,13 @@ fmt: ## Run autoformatting and linting cargo fmt --all dprint fmt $(VENV_BIN)/typos + +.PHONY: fix +fix: + cargo fix --workspace --all-targets --all-features + # We allow dirty on this one, if the repo was dirty the previous command would've failed. + cargo clippy --workspace --all-targets --all-features --fix --allow-dirty + .PHONY: pre-commit pre-commit: fmt clippy clippy-default ## Run all code quality checks diff --git a/crates/Makefile b/crates/Makefile index 749293ca3d08..1945d91cc21a 100644 --- a/crates/Makefile +++ b/crates/Makefile @@ -3,6 +3,10 @@ SHELL=bash BASE ?= main +.PHONY: fix +fix: + @$(MAKE) -s -C .. $@ + .PHONY: fmt fmt: ## Run rustfmt and dprint cargo fmt --all diff --git a/py-polars/Makefile b/py-polars/Makefile index 3d9e5d7ffddc..27ceee5d8ea9 100644 --- a/py-polars/Makefile +++ b/py-polars/Makefile @@ -41,6 +41,10 @@ build-debug-release: .venv ## Same as build-release, but with full debug symbol .PHONY: build-dist-release build-dist-release: .venv ## Compile and install Python Polars binary with super slow extra optimization turned on, for distribution @$(MAKE) -s -C .. $@ + +.PHONY: fix +fix: + @$(MAKE) -s -C .. $@ .PHONY: lint lint: .venv ## Run lint checks (only) From 0fd9c9574786f3edcbd201cc47ae9661e9d50a8d Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Fri, 31 Jan 2025 12:20:06 +0100 Subject: [PATCH 2/2] clippy --fix seems to cover cargo fix already --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8dcd81819b61..84f55912ad92 100644 --- a/Makefile +++ b/Makefile @@ -140,9 +140,9 @@ fmt: ## Run autoformatting and linting .PHONY: fix fix: - cargo fix --workspace --all-targets --all-features - # We allow dirty on this one, if the repo was dirty the previous command would've failed. - cargo clippy --workspace --all-targets --all-features --fix --allow-dirty + cargo clippy --workspace --all-targets --all-features --fix + @# Good chance the fixing introduced formatting issues, best to just do a quick format. + cargo fmt --all .PHONY: pre-commit