-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support running vale locally #22130
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Would it make sense to implement this just as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move to another PR the change related to new validate
make goal? Doesn't relate to "feat: support running vale locally" and we should not enumerate unrelated change requests in the same PR tbh.
This reverts commit 973a4a2.
* main: (42 commits) Update image source for kafbat Add missing release note to Docker Desktop release notes (docker#22218) Update build-summary.md feedback link fix: (docker#22212) some clarification on additional_contexts (docker#22204) Update windows-install.md (docker#22184) sso: add callout to certificate instructions (docker#22193) chore: cleanup includes w/ embedded shortcodes (docker#22191) fix: rendering issue w/ experimental labs include (docker#22190) billing: improve docs for manual payment retries (docker#22181) build: fix intro of distributed build section (docker#22189) dd-cli-cicd-fix (docker#22187) Update release note for 4.39 (docker#22188) Change directory after pulling a sample Docker application (docker#22179) Merge pull request docker#22117 from aevesdocker/ENGDOCS-2451 fix: troubleshooting toc fix (docker#22166) Add security section to 4.39.0 release notes (docker#22178) Merge pull request docker#22175 from aevesdocker/ENGDOCS-2470 Merge pull request docker#22160 from sarahsanders-docker/tcc-minutes hub: add troubleshooting (docker#22157) ...
# Docker image to use for vale. | ||
VALE_IMAGE := jdkato/vale:latest | ||
|
||
.PHONY: vale | ||
vale: ## run vale | ||
docker run --rm -v $(PWD):/docs \ | ||
-w /docs \ | ||
-e PIP_BREAK_SYSTEM_PACKAGES=1 \ | ||
$(VALE_IMAGE) $(CONTENT_DIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we could have it running within our Dockerfile so it could be used with bake like lint
:
Lines 48 to 52 in 9623874
target "lint" { target = "lint" output = ["type=cacheonly"] provenance = false } Lines 53 to 60 in 9623874
# lint lints markdown files FROM davidanson/markdownlint-cli2:v0.14.0 AS lint USER root RUN --mount=type=bind,target=. \ /usr/local/bin/markdownlint-cli2 \ "content/**/*.md" \ "#content/manuals/engine/release-notes/*.md" \ "#content/manuals/desktop/previous-versions/*.md"
Then we could just add a vale
bake target to validate
group?
Lines 38 to 40 in 9623874
group "validate" { | |
targets = ["lint", "test", "unused-media", "test-go-redirects", "dockerfile-lint", "path-warnings"] | |
} |
And would probably be able to remove this ci job
docs/.github/workflows/build.yml
Lines 77 to 86 in 9623874
vale: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: errata-ai/vale-action@reviewdog | |
env: | |
PIP_BREAK_SYSTEM_PACKAGES: 1 | |
with: | |
files: content |
And just add vale
to this matrix
docs/.github/workflows/build.yml
Lines 93 to 99 in 9623874
target: | |
- lint | |
- test | |
- unused-media | |
- test-go-redirects | |
- dockerfile-lint | |
- path-warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to create a foundational knowledge on bake, but it seems reasonable to include the target as part of the current build system. I'd go with what you suggest
Description
This PR adds two Make goals:
docker buildx bake validate
The first one allows contributors to detect grammar errors while working on their changes, and the second is an alias for the build command.
The intention here is to enhance the local development experience when contributing to the docs, not having to wait for the CI to understand the vale errors, but instead making it possible to run it locally.
Reviews