From 1dc4a4fc7d65a7a0d64bbfd111e141a4f9a5960a Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 15 Feb 2024 15:52:53 -0500 Subject: [PATCH] Standardize `make lint` target in components In some places the `lint` target is just flake8 and in others it runs all linters. Adopt the latter definition to ensure that `make lint` runs all tools that don't run any code. --- client/Makefile | 9 ++++++--- export/Makefile | 10 +++++++--- log/Makefile | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/client/Makefile b/client/Makefile index 92d0485ac..afa117fc8 100644 --- a/client/Makefile +++ b/client/Makefile @@ -109,12 +109,15 @@ test-functional: ## Run the functional tests test-sdk: ## Run just the sdk tests @poetry run pytest -v $(STESTS) -.PHONY: lint -lint: ## Run the linters +.PHONY: flake8 +flake8: ## Run flake8 linting @poetry run flake8 securedrop_client tests +.PHONY: lint +lint: check-black check-isort flake8 mypy semgrep ## Run all linters + .PHONY: check -check: clean check-black check-isort semgrep lint mypy test-random test-integration test-functional ## Run the full CI test suite +check: clean lint test-random test-integration test-functional ## Run the full CI test suite # Explanation of the below shell command should it ever break. # 1. Set the field separator to ": ##" and any make targets that might appear between : and ## diff --git a/export/Makefile b/export/Makefile index ad65eaade..ba88300a9 100644 --- a/export/Makefile +++ b/export/Makefile @@ -1,8 +1,12 @@ .PHONY: all all: help +.PHONY: lint +lint: check-black flake8 mypy semgrep ## Run all linters + + .PHONY: check -check: lint mypy semgrep test check-black ## Run linter and tests +check: lint test ## Run linter and tests .PHONY: check-black check-black: ## Check Python source code formatting with black @@ -13,8 +17,8 @@ TESTS ?= tests test: ## Run tests poetry run pytest -v --cov-report html --cov-report term-missing --cov=securedrop_export $$TESTS -.PHONY: lint -lint: ## Run linter +.PHONY: flake8 +flake8: ## Run flake8 linter poetry run flake8 securedrop_export/ tests/ .PHONY: mypy diff --git a/log/Makefile b/log/Makefile index 0d5febc56..79180d4cf 100644 --- a/log/Makefile +++ b/log/Makefile @@ -2,7 +2,10 @@ DEFAULT_GOAL: help SHELL := /bin/bash .PHONY: check -check: flake8 mypy test +check: lint test + +.PHONY: lint +lint: flake8 mypy ## Run all linters .PHONY: flake8 flake8: ## Run flake8 to lint Python files