Skip to content

Commit

Permalink
Standardize make lint target in components
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
legoktm committed Feb 15, 2024
1 parent e7b7d0c commit 1dc4a4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
9 changes: 6 additions & 3 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down
10 changes: 7 additions & 3 deletions export/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion log/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1dc4a4f

Please sign in to comment.