MonkeyCanCode commented on code in PR #171:
URL: https://github.com/apache/polaris-tools/pull/171#discussion_r2831371479


##########
console/Makefile:
##########
@@ -1,37 +1,91 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
 
+# Configures the shell for recipes to use bash, enabling bash commands and 
ensuring
+# that recipes exit on any command failure (including within pipes).
+SHELL = /usr/bin/env bash -o pipefail
+.SHELLFLAGS = -ec
+
+## Variables
 DOCKER ?= docker
 DOCKER_IMAGE_NAME ?= apache/polaris-console
 DOCKER_IMAGE_TAG ?= latest
 
-.PHONY: build-docker
-build-docker:
-       @$(DOCKER) build -f docker/Dockerfile -t 
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
+## Version information
+BUILD_VERSION := $(shell grep version package.json | sed 's/.*"version": 
"\(.*\)".*/\1/')
+GIT_COMMIT := $(shell git rev-parse HEAD)
 
+##@ General
 
-.PHONY: install
-install:
-       npm install
+.PHONY: help
+help: ## Display this help
+       @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make 
\033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\.-]+:.*?##/ { printf "  
\033[36m%-40s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", 
substr($$0, 5) } ' $(MAKEFILE_LIST)
 
-.PHONY: lint
-lint: format-check
-       npm run lint
+.PHONY: version
+version: ## Display version information
+       @echo "Build version: ${BUILD_VERSION}"
+       @echo "Git commit: ${GIT_COMMIT}"
 
-.PHONY: format-fix
-format-fix:
-       npm run format
+##@ Polaris Console
 
-.PHONE: lint-fix
-lint-fix: format-fix
-       npm run lint -- --fix
+.PHONY: build
+build: lint ## Lint the console project
+       @echo "--- Building console project---"
+       @npm run build
+       @echo "--- Console project built ---"
+
+.PHONY: build-docker
+build-docker: install ## Build docker image for console project
+       @echo "--- Building docker image for console project---"
+       @$(DOCKER) build -f docker/Dockerfile -t 
$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
+       @echo "--- Docker image for console project built ---"
+
+.PHONY: dev
+dev: install ## Run the console project in development mode
+       @echo "--- Running console project in development mode ---"
+       @npm run dev
+       @echo "--- Console project in development mode completed ---"
 
 .PHONY: format-check
-format-check:
-       npm run format:check
+format-check: install ## Fix formatting in the console project
+       @echo "--- Checking formatting in the console project ---"
+       @npm run format:check
+       @echo "--- Formatting in the console project checked ---"
 
-.PHONY: build
-build: lint
-       npm run build
+.PHONY: format-fix
+format-fix: install ## Fix linting issues in the console project
+       @echo "--- Fixing formatting in the console project ---"
+       @npm run format
+       @echo "--- Formatting in the console project fixed ---"
 
-.PHONY: dev
-dev:
-       npm run dev
\ No newline at end of file
+.PHONY: install
+install: ## Install dependencies for console project
+       @echo "--- Install dependencies for console project ---"
+       @npm install
+       @echo "--- Dependencies for console project completed ---"
+
+.PHONY: lint
+lint: format-check ## Lint the console project
+       @echo "--- Linting the console project ---"
+       @npm run lint
+       @echo "--- Console project linted ---"
+
+.PHONE: lint-fix
+lint-fix: format-fix ## Check formatting in the console project

Review Comment:
   Yes. Somehow my last changes were not commit. Thanks for catching this. 
Fixed now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to