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: Adding vale linter #198

Closed
wants to merge 16 commits into from
Closed

Conversation

CBID2
Copy link
Contributor

@CBID2 CBID2 commented Oct 23, 2023

Description

This PR adds the code for the Vale linter GitHub Action to the compliance.yml file. This addition will ease the process of maintaining docs in regards to checking for Markdown errors.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Closes #178

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Update 10/24/22

Per @nickytonline's suggestion, I'm testing the Vale Linter GitHub action in this test repo. So far, I used this method to place the action's suggested code into the compliance.yml file.

name: "Compliance"

on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize

permissions:
  pull-requests: write

jobs:
  compliance:
    uses: open-sauced/hot/.github/workflows/compliance.yml@main
    name: reviewdog
    on: [pull_request]
    workflow_dispatch:

  vale:
    name: runner / vale
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v3
      - name: linting
        uses: errata-ai/vale-action@reviewdog
        files: "* .md"
       

What's weird is that I got this result when I copied the code in a YML validator

yaml-checker-results

But got these results in my terminal

from my terminal Hopefully, things will be better tomorrow

Update 10/30/23

I reread the documentation for the GitHub Action and apparently, it is recommended to follow this repo style:

.github
├── styles
│   └── vocab.txt
└── workflows
    └── main.yml
.vale.ini
...

Now the hard part is figuring out what to put in the vocab.txt. 🤔

Added to documentation?

  • 📜 README.md
  • 📓 docs.opensauced.pizza
  • 🍕 dev.to/opensauced
  • 📕 storybook
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Once the PR is merged, make sure to click on Read and write permissions in action settings.

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Oct 23, 2023

👷 Deploy request for docs-open pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 208da53

@CBID2 CBID2 self-assigned this Oct 23, 2023
@CBID2 CBID2 added 💡 feature A label to note if work is a feature 📝 documentation labels Oct 23, 2023
@CBID2 CBID2 changed the title Adding vale linter feat: Adding vale linter Oct 23, 2023
@nickytonline
Copy link
Member

What's weird is that I got this result when I copied the code in a YML validator

yaml-checker-results

But got these results in my terminal

from my terminal

Hopefully, things will be better tomorrow

It's valid YAML, but it doesn't seem to be correct for what a GitHub action expects. I'd double check the Vale linter docs and also compare it to some existing actions in the app repo in terms of GitHub action syntax.

steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@reviewdog
files: "* .md"

Choose a reason for hiding this comment

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

This should be:

- uses: errata-ai/vale-action@reviewdog
  with:
    files: "* .md"

And it looks like the value for files should be a path: https://github.com/errata-ai/vale-action#files-default-all

CBID2 and others added 4 commits October 29, 2023 00:12
Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
Co-authored-by: Kyle a.k.a. TechSquidTV <KyleTryon@users.noreply.github.com>
@BekahHW
Copy link
Member

BekahHW commented Nov 8, 2023

@CBID2 how's this going?

@CBID2
Copy link
Contributor Author

CBID2 commented Nov 8, 2023

@CBID2 how's this going?

Still struggling with the configuration @BekahHW.

@BekahHW
Copy link
Member

BekahHW commented Nov 8, 2023

@CBID2 when you get a chance, share what you've tried and where you've looked in their docs and maybe we can point you in the right direction. Also, let us know how you're testing it.

@BekahHW
Copy link
Member

BekahHW commented Jan 4, 2024

Hey @CBID2 are you still working on this issue?

@CBID2
Copy link
Contributor Author

CBID2 commented Jan 4, 2024

Hey @CBID2 are you still working on this issue?

Yeah I am @BekahHW. I just learned about this in Vale's documentation: https://vale.sh/generator/
Which one do you think would be best suited for this repo?

@BekahHW
Copy link
Member

BekahHW commented Jan 4, 2024

Hey @CBID2 are you still working on this issue?

Yeah I am @BekahHW. I just learned about this in Vale's documentation: vale.sh/generator Which one do you think would be best suited for this repo?

Can you explain what that is and why we need it? I need some more context before I look at it.

@CBID2
Copy link
Contributor Author

CBID2 commented Jan 4, 2024

Hey @CBID2 are you still working on this issue?

Yeah I am @BekahHW. I just learned about this in Vale's documentation: vale.sh/generator Which one do you think would be best suited for this repo?

Can you explain what that is and why we need it? I need some more context before I look at it.

It's a generator that creates the config files for Vale based on the style guides people choose (e.g., Google and Microsoft) and the static generators that is used (e.g., Hugo). Does that make more sense now @BekahHW?

@nickytonline
Copy link
Member

I'm going to go ahead and close this as it's been open since Oct 2023. Feel free to reopen if you plan to continue working on this.

@CBID2 CBID2 reopened this Feb 10, 2024
@CBID2
Copy link
Contributor Author

CBID2 commented Feb 10, 2024

I'm going to go ahead and close this as it's been open since Oct 2023. Feel free to reopen if you plan to continue working on this.

Hey @nickytonline. I think I found a possible solution. Can you make a PR on my test repo again: https://github.com/CBID2/github-actions-test-for-vale

@BekahHW
Copy link
Member

BekahHW commented Feb 22, 2024

Hey @CBID2, If you can't get this resolved in the next week, let's let someone else try taking on the issue, since you've had it since October.

@CBID2
Copy link
Contributor Author

CBID2 commented Feb 22, 2024

Hey @CBID2, If you can't get this resolved in the next week, let's let someone else try taking on the issue, since you've had it since October.

Hi @BekahHW. I made some new updates to my test repo, and was hoping that Nick would do another PR to it but I never got a response. Can you try it: https://github.com/CBID2/github-actions-test-for-vale

@BekahHW
Copy link
Member

BekahHW commented Feb 22, 2024

I saw that Ryan submitted a PR that failed. That's why I didn't.

@CBID2
Copy link
Contributor Author

CBID2 commented Feb 22, 2024

I saw that Ryan submitted a PR that failed. That's why I didn't.

Thanks for pointing it out @BekahHW. Just checked it out

@CBID2
Copy link
Contributor Author

CBID2 commented Feb 28, 2024

Hey @BekahHW. To update you, I worked on my test branch with someone at Virtual Coffee and here's a solution we came up with: https://github.com/CBID2/github-actions-test-for-vale/pull/10/checks
As you can see, the action does point out the file's errors, but the checkmark in the runner/vale test remains green. Do you recommend that I put this approach in this PR and then create an issue for someone to help the action show red for the vale test?

@nickytonline
Copy link
Member

There's no point in adding it if it's only partially working.

I don't see where it's reporting the file errors in what you linked. I see changes to the GitHub action file in that PR, but that's it.

It should look like this like they have in their docs.

Do you have a test PR in your repo showing where it displays lint errors in some text?

@CBID2
Copy link
Contributor Author

CBID2 commented Feb 29, 2024

There's no point in adding it if it's only partially working.

I don't see where it's reporting the file errors in what you linked. I see changes to the GitHub action file in that PR, but that's it.

It should look like this like they have in their docs.

Do you have a test PR in your repo showing where it displays lint errors in some text?

Here's what I am referring to @nickytonline
errors
To answer your question, no

@CBID2
Copy link
Contributor Author

CBID2 commented Mar 1, 2024

Hi @nickytonline! :) I have good news! :) I managed to get Vale to work via this PR: CBID2/github-actions-test-for-vale#13 (comment)
What I have to do now is make it show up in the text as shown in the picture you posted.

@CBID2
Copy link
Contributor Author

CBID2 commented Mar 6, 2024

Hey @nickytonline. Somehow in my test repo, the errors have appeared in the log but the annotations have appeared on the present file and not the one I’m pushing. I raised an issue about this to Vale’s repo, so hopefully, I'll get a response

@CBID2 CBID2 closed this Apr 3, 2024
@CBID2 CBID2 deleted the adding-vale-linter branch April 3, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 documentation 💡 feature A label to note if work is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add Documenation Linting to CI/CD
5 participants