sphinx-lint icon indicating copy to clipboard operation
sphinx-lint copied to clipboard

[question] Problem matcher for sphinx-lint ?

Open rffontenelle opened this issue 1 year ago • 5 comments

Is there a problem matcher for sphinx-lint's output? I tried sphinx-doc/github-problem-matcher but it seems to be designed for Sphinx output.

rffontenelle avatar Dec 22 '23 23:12 rffontenelle

I don't think so.

I'll be OK to tweak output a bit if needed for it to be more "standard", so if a standard problem matcher exists it could be used.

JulienPalard avatar Dec 23 '23 09:12 JulienPalard

Note:

  1. GitHub Actions recognizes trailing "error" and "warning" (case insensitive) and turn them into issue annotations, without the need for a problem matcher specification file.

  2. Sphinx's problem matcher almost fit sphinx-lint output, except for two situations. First is severity: Sphinx build shows "warning" and "error", and sphinx-lint doesn't. The second is that it has loose match the looks for .rst file, but sphinx-lint also works in Gettext translation file (.po).

For now I created an action for it: https://github.com/rffontenelle/sphinx-lint-problem-matcher/blob/main/sphinx_lint_matcher.json

rffontenelle avatar Dec 23 '23 14:12 rffontenelle

@rffontenelle So you can add a link to your matcher from sphinx-lint README, and call it a day?

JulienPalard avatar Dec 23 '23 17:12 JulienPalard

It is actually a GitHub Actions action. You call it like:

- name: Checkout the repo source code
  uses: actions/checkout@v4

- name: Add problem matcher:
  uses: rffontenelle/sphinx-lint-problem-matcher@master

- name: Lint
  run: sphinx-lint /path/to/file

rffontenelle avatar Dec 23 '23 18:12 rffontenelle

Is there an interest in adding this problem-matcher action to this repository or other sphinx-related (i.e. making it official) ? Case not, I believe this issue can be closed.

rffontenelle avatar Sep 18 '24 01:09 rffontenelle