Skip to content

Commit

Permalink
Adjust Make targets after feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Gera <matejgera@gmail.com>
  • Loading branch information
matej-g committed Feb 22, 2022
1 parent 3e47bd0 commit 96ea922
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Check docs
run: make docs
run: make check-docs
- name: Check examples
run: make check-examples
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,29 +213,33 @@ $(PUSH_DOCKER_ARCHS): docker-push-%:
@docker tag "thanos-linux-$*" "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)"
@docker push "$(DOCKER_IMAGE_REPO)-linux-$*:$(DOCKER_IMAGE_TAG)"

.PHONY: generate-docs
generate-docs: ## Generates docs for all thanos commands, localise links, ensure GitHub format.
generate-docs: build examples $(MDOX)
.PHONY: docs
docs: ## Generates docs for all thanos commands, localise links, ensure GitHub format.
docs: build examples $(MDOX)
@echo ">> generating docs"
PATH="${PATH}:$(GOBIN)" $(MDOX) fmt -l --links.localize.address-regex="https://thanos.io/.*" --links.validate.config-file=$(MDOX_VALIDATE_CONFIG) $(MD_FILES_TO_FORMAT)
PATH="${PATH}:$(GOBIN)" $(MDOX) fmt --links.localize.address-regex="https://thanos.io/.*" $(MD_FILES_TO_FORMAT)
$(MAKE) white-noise-cleanup

.PHONY: changed-docs
changed-docs: ## Only do the docs check for files that have been changed (git status)
changed-docs: build examples $(MDOX)
@echo ">> generating docs on changed files"
PATH="${PATH}:$(GOBIN)" $(MDOX) fmt -l --links.localize.address-regex="https://thanos.io/.*" --links.validate.config-file=$(MDOX_VALIDATE_CONFIG) $(FAST_MD_FILES_TO_FORMAT)
PATH="${PATH}:$(GOBIN)" $(MDOX) fmt --links.localize.address-regex="https://thanos.io/.*" $(FAST_MD_FILES_TO_FORMAT)
$(MAKE) white-noise-cleanup

.PHONY: docs
docs: ## checks and formats docs against discrepancy with flags, links, white noise.
docs: generate-docs
.PHONY: check-docs
check-docs: ## Checks docs against discrepancy with flags, links, white noise.
check-docs: build examples $(MDOX)
@echo ">> checking docs"
PATH="${PATH}:$(GOBIN)" $(MDOX) fmt -l --links.localize.address-regex="https://thanos.io/.*" --links.validate.config-file=$(MDOX_VALIDATE_CONFIG) $(MD_FILES_TO_FORMAT)
$(MAKE) white-noise-cleanup
$(call require_clean_work_tree,'run make docs and commit changes')

.PHONY: white-noise-cleanup
white-noise-cleanup: ## Cleans up white noise in docs.
white-noise-cleanup:
@echo ">> detecting white noise"
@echo ">> cleaning up white noise"
@find . -type f \( -name "*.md" \) | SED_BIN="$(SED)" xargs scripts/cleanup-white-noise.sh
$(call require_clean_work_tree,'run make docs and commit changes')

.PHONY: shell-format
shell-format: $(SHFMT)
Expand Down

0 comments on commit 96ea922

Please sign in to comment.