errata-ai / vale-action

:octocat: The official GitHub Action for Vale -- install, manage, and run Vale with ease.
MIT License
195 stars 46 forks source link

Vale action seems to be missing rst support #117

Open nick-vanpraet opened 7 months ago

nick-vanpraet commented 7 months ago

It keeps checking :ref: URLs, and other text that should be excluded. And indeed is excluded if I run vale locally or in a Docker container. But running it via this action does not work.

Do I need to specify a container to use which already has rst2html or sphinx installed? (I'm currently trying that but now it can't find gem so if that is the case I fear I shall need some help with that as well if y'all are willing).

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: Vale
      uses: errata-ai/vale-action@reviewdog
      with:
        version: 2.29.2
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This finds things it shouldn't, it's checking stuff like :ref:`components/php/forms:Forms` and saying php should be PHP, etc.

jobs:
  prose_test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-python@v4
        with:
          python-version: '3.x'
          cache: 'pip'

      - name: Install Python dependencies
        run: pip3 install -r docs/requirements.txt

      - name: Vale install
        working-directory: docs
        run: mkdir -p vale && cd vale && wget https://github.com/errata-ai/vale/releases/download/v2.29.2/vale_2.29.2_Linux_64-bit.tar.gz && tar -xf vale_2.29.2_Linux_64-bit.tar.gz && mv ./vale /usr/local/bin/vale && cd ../ && rm -rf vale

      - name: Vale check
        working-directory: docs
        run: vale ./

This action however works fine, so I have to imagine it's missing something in the first action.

nick-vanpraet commented 7 months ago

Ok, this works. I'm not sure that's the way to go, if anyone has a better suggestions please:

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - uses: actions/setup-python@v4
      with:
        python-version: '3.x'
        cache: 'pip'

    - name: Install Python dependencies
      run: pip3 install -r docs/requirements.txt

    - name: Vale
      uses: errata-ai/vale-action@reviewdog
      with:
        version: 2.29.2
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
spier commented 5 months ago

hi @nick-vanpraet.

There is some documentation related to rst here: https://vale.sh/docs/topics/scoping/#restructuredtext

I have not used vale with reStructuredText but with AsciiDoc instead. For that I had to install a gem locally as well, to use vale locally.

However when using this GitHub Action here it worked out of the box, so I assume those extra gems come pre-packaged with the GHA.