File tree Expand file tree Collapse file tree 2 files changed +31
-19
lines changed
Expand file tree Collapse file tree 2 files changed +31
-19
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ URL="${BASE_URL}/api/${API_VERSION}/schemas"
1313
1414include ci_tests.mk
1515
16+ # Common command components
17+ RUFF = .venv/bin/ruff
18+
1619all :
1720 echo " Nothing here yet."
1821
2326
2427.PHONY : lint
2528lint :
26- .venv/bin/ruff check .
29+ $( RUFF ) check .
2730
2831.PHONY : lint-fix
2932lint-fix :
30- .venv/bin/ruff check . --fix
33+ $( RUFF ) check . --fix
3134
3235.PHONY : format
3336format :
34- .venv/bin/ruff format --check .
35-
36- .PHONY : format-diff
37- format-diff :
38- .venv/bin/ruff format --diff .
37+ $(RUFF ) format --check .
3938
4039.PHONY : format-fix
4140format-fix :
42- .venv/bin/ruff format .
43- .venv/bin/ruff check . --fix --fixable I
41+ $(RUFF ) format .
42+
43+ .PHONY : format-diff
44+ format-diff :
45+ $(RUFF ) format --diff .
4446
4547
4648define download_client
@@ -51,8 +53,6 @@ define generate_client
5153 ./scripts/generate_client.sh gooddata-$(1 ) -client -f "/local/schemas/gooddata-$(1 ) -client.json"
5254endef
5355
54-
55-
5656.PHONY : api-client
5757api-client : download
5858 rm -f schemas/gooddata-api-client.json
Original file line number Diff line number Diff line change 11# (C) 2021 GoodData Corporation
2+
3+ # Common command components (run from workspace root, scoped to this package)
4+ ROOT_DIR = ../..
5+ RUFF = $(ROOT_DIR ) /.venv/bin/ruff
6+ PKG_PATH = packages/$(CURR_DIR_BASE_NAME )
7+
28TOX_FLAGS =
39ifeq (1,$(RECREATE_ENVS ) )
410 TOX_FLAGS += -r
@@ -14,7 +20,6 @@ ifdef ADD_ARGS
1420 LOCAL_ADD_ARGS := -- $(ADD_ARGS)
1521endif
1622
17-
1823# linting and formatting tools have configuration in root dir to support pre-commit - use it
1924# ruff uses root directory to have the same per-file-ignores config parameter for all packages
2025CURR_DIR_BASE_NAME = $(notdir $(CURDIR ) )
@@ -23,18 +28,25 @@ CURR_DIR_BASE_NAME = $(notdir $(CURDIR))
2328all :
2429 echo " Nothing here yet."
2530
31+ .PHONY : lint
32+ lint :
33+ (cd $( ROOT_DIR) ; $( RUFF) check $( PKG_PATH) )
34+
35+ .PHONY : lint-fix
36+ lint-fix :
37+ (cd $( ROOT_DIR) ; $( RUFF) check $( PKG_PATH) --fix)
38+
2639.PHONY : format
2740format :
28- (cd ../..; .venv/bin/ruff format --check packages/$( CURR_DIR_BASE_NAME) )
29-
30- .PHONY : format-diff
31- format-diff :
32- (cd ../..; .venv/bin/ruff format --diff packages/$( CURR_DIR_BASE_NAME) )
41+ (cd $( ROOT_DIR) ; $( RUFF) format --check $( PKG_PATH) )
3342
3443.PHONY : format-fix
3544format-fix :
36- (cd ../..; .venv/bin/ruff format packages/$( CURR_DIR_BASE_NAME) )
37- (cd ../..; .venv/bin/ruff check --fix packages/$( CURR_DIR_BASE_NAME) )
45+ (cd $( ROOT_DIR) ; $( RUFF) format $( PKG_PATH) )
46+
47+ .PHONY : format-diff
48+ format-diff :
49+ (cd $( ROOT_DIR) ; $( RUFF) format --diff $( PKG_PATH) )
3850
3951.PHONY : mypy
4052mypy :
You can’t perform that action at this time.
0 commit comments