Skip to content
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(docs): Add vale style checker #419

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

feat(docs): Add vale style checker #419

wants to merge 8 commits into from

Conversation

merkata
Copy link
Contributor

@merkata merkata commented Sep 24, 2024

Applicable spec:

Overview

Adds the vale action with the Canonical vale styles.

The Canonical styles are hosted at praecepta and we're making use of the recommended workflow that is supplied in the README.md. In addition to our operator-workflows, data-platform-doc-tools is using the same workflow.

The vale action being used is the official one.

Rationale

Vale is gaining adoption as a doc style checker, hence including it in our workflow to test things out (currently it will not fail the action).

Workflow Changes

The test.yaml contains a style checker job after woke.

Checklist

  • [x ] The contributing guide was applied
  • [x ] The PR is tagged with appropriate label (urgent, trivial, complex)

@merkata merkata requested a review from a team as a code owner September 24, 2024 10:44
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout repo to runner
uses: actions/checkout@v3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind pinning to a specific version? Also, does this mean we'll be dropping codespell?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 👋 , I set it to use v4.1.7 like the other steps, good catch! We're not dropping anything, I consider vale in a pilot phase where we can see what it suggests and take notes - it will annotate the docs and it will not fail the job. Like we do with Dockerfile linting with hadolint.

@merkata
Copy link
Contributor Author

merkata commented Sep 24, 2024

@arturo-seijas @erinecon @gregory-schiano this is mergeable now, note that for github runners I have to explicitly install tree and ruby-rubygems for now. Using this for a while should give us insights into what to improve in the docs/ folders of our charms and also contribute back to https://github.com/canonical/praecepta that hosts the Canonical styles.
Idea is to test this early on and see how that works, no roadmap item or anything, pure dev fun atm.

- name: Run Vale tests
uses: errata-ai/vale-action@reviewdog
with:
files: ./docs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
files: ./docs
files: ${{ inputs.charm-directory }}/docs

This would allow the check to run for paas-app-charmer charms, which usually have the docs living in charm/docs, see https://github.com/canonical/netbox/tree/main/charm/docs and https://github.com/canonical/netbox/blob/main/.github/workflows/test.yaml#L11 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants