helm-docs icon indicating copy to clipboard operation
helm-docs copied to clipboard

[Feature request] Argument to checks if the documentation is up-to-date

Open vzabawski opened this issue 2 years ago • 5 comments

It would be nice to have an argument which allows running helm-docs for checking if README is up-to-date. Such argument is very handy in CI workflows when you just need to check if the documentation is relevant, not to update it.

Here's how it might look like:

Running helm-docs in repo with up-to-date readme

$ helm-docs --check
Up-to-date
$ echo $?
0

Running helm-docs in repo with outdated readme

$ helm-docs --check
README needs to be updated
$ echo $?
2

vzabawski avatar May 11 '22 12:05 vzabawski

I would also like to see this. We're using git to check if anything changed, but ideally the exit code would work for this.

name: Docs check

on: pull_request

defaults:
  run:
    shell: bash

jobs:
  docs-check:
    runs-on: [self-hosted, Linux, X64]
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}

      - name: Ensure documentation is updated
        uses: docker://jnorwood/helm-docs:latest

      - name: Check for changes
        run: |
          if git diff --exit-code; then
            echo -e "\n####### Git is clean\n"
          else
            git status
            echo -e "\n####### Git changes detected! Check and commit changes !!!\n"
            exit 1
          fi

GMartinez-Sisti avatar Sep 09 '22 09:09 GMartinez-Sisti

Might be a good thing to check for it. Will add on the list to look further into it.

Nepo26 avatar Jun 29 '23 11:06 Nepo26

Do you need any help with this @Nepo26? I'd really like to have this and I'd be happy to pitch in if you need the help

jhoover4 avatar Oct 10 '23 23:10 jhoover4

Yes, I would like some help @jhoover4. Can you check if this falls under the same function of strict mode? If not, can you provide some examples of how do you think this function should work? I don't think a README needs to be updated is enough, this probably can be more verbose.

Nepo26 avatar Oct 11 '23 14:10 Nepo26

Yeah I'm honestly not sure if we need this after we include strict mode. If strict mode is on and you dont want an aspect documented, you should just need to put @ignore right? I think we should focus more on making sure all the corner cases in strict mode are good.

From there maybe we could add a part in the README saying you can achieve this by turning on strict mode and making sure everything is commented or has an @ignore

jhoover4 avatar Oct 11 '23 15:10 jhoover4