-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (37 loc) · 1.49 KB
/
Makefile
File metadata and controls
53 lines (37 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.DEFAULT_GOAL := help
PYTORCH_DOCKER_IMAGE = pytorch/pytorch:1.8.1-cuda11.1-cudnn8
PYTHON_DOCKER_IMAGE = python:3.8-buster
GIT_DESCRIBE = $(shell git describe --first-parent)
ARCHIVE = compressai_vision.tar.gz
src_dirs := compressai_vision scripts/metrics
.PHONY: help
help: ## Show this message
@echo "Usage: make COMMAND\n\nCommands:"
@grep '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' | cat
# Check style and linting
.PHONY: check-ruff-format check-ruff-organize-imports check-ruff-lint check-mypy static-analysis
check-ruff-format: ## Run ruff format checks
@echo "--> Running ruff format checks"
@ruff format --check $(src_dirs)
check-ruff-organize-imports: ## Run ruff organize imports checks
@echo "--> Running ruff organize imports checks"
@ruff check --ignore ALL --select I $(src_dirs)
check-ruff-lint: ## Run ruff lint checks
@echo "--> Running ruff lint checks"
@ruff check $(src_dirs)
# check-mypy: ## Run mypy checks
# @echo "--> Running mypy checks"
# @mypy
# code-format:
# @echo "--> Running black"
# @black $(src_dirs)
# @echo "--> Running isort"
# @isort $(src_dirs)
static-analysis: check-ruff-format check-ruff-organize-imports check-ruff-lint # check-mypy ## Run all static checks
# Apply styling
.PHONY: style
style: ## Apply style formating
@echo "--> Running ruff format"
@ruff format $(src_dirs)
@echo "--> Running ruff check --ignore ALL --select I"
@ruff check --ignore ALL --select I $(src_dirs) --fix