[#164] Makefile: Add clang-format support

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-11-06 15:55:11 +03:00
parent af5f29e1ff
commit 709706da0d
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD

View file

@ -76,20 +76,7 @@ lint:
$(LINT_DIR)/golangci-lint run --timeout=5m $(LINT_DIR)/golangci-lint run --timeout=5m
clang: clang:
@if [ ! -d "$(OUTPUT_LINT_DIR)/clang" ]; then \ @clang-format -i **/*.js
make clang-install; \
fi
# @$(OUTPUT_LINT_DIR)/clang/clang-format -i **/*.js
clang-install:
@mkdir -p $(TMP_DIR)/llvm
@curl -L -o $(TMP_DIR)/llvm/llv-$(LLVM_VERSION)-linux-x64.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LLVM_VERSION)/LLVM-$(LLVM_VERSION)-Linux-X64.tar.xz
@mkdir -p $(OUTPUT_LINT_DIR)/clang
@tar -xJf $(TMP_DIR)/llvm/llv-$(LLVM_VERSION)-linux-x64.tar.xz --strip-components=2 -C $(OUTPUT_LINT_DIR)/clang LLVM-$(LLVM_VERSION)-Linux-X64/bin/clang-format
@rm -r $(TMP_DIR) 2>/dev/null || true
llvm-version:
@echo $(LLVM_VERSION)
# Install linters # Install linters
lint-install: lint-install: