ChiefGokhlayeh / textidote-action

GitHub Action to lint, spell- and grammar-check LaTeX documents using TeXtidote.
MIT License
7 stars 1 forks source link

Linting a directory #89

Open nimonian opened 6 months ago

nimonian commented 6 months ago

Is there any way to pass a directory rather than a single file?

For example,

src
-- a.md
-- b.md

I'd like to run textidote on all the markdown files in src as a github action.

ChiefGokhlayeh commented 6 months ago

I would need to do some testing myself before being able to fully answer your question.

Passing a directory is not supported by the underlying textidote. TeXtidote can, however, process a list of files. Although, I think this is currently not supported by my GitHub Action script.

Note, this GitHub Action is not directly affiliated with the tool itself, rather, it's just a slim layer on top. If you want to process the contents of a directory, I see two options:

1) Extend the entrypoint.sh script to support globs, enabling something like this:

    ...
    steps:
      uses: ChiefGokhlayeh/textidote-action@v...
      with:
       root_file: src/*.md
    ...
I am unsure whether the current implementation supports this.

2) Bring up the request to support directories with the authors of textidote.

PRs welcome!

ChiefGokhlayeh commented 6 months ago

Running the underlying textidote with a globbing expression looks like this:

$ textidote --output html test/*.tex > report.html
TeXtidote v0.8.3 - A linter for LaTeX documents and others
(C) 2018-2021 Sylvain Hallé - All rights reserved

Found 21 warning(s)
Total analysis time: 0 second(s)

The resulting report.html lists a section for reach input file that got processed via the glob. Note the glob is expanded by the shell, not textidote. A similar mechanism would need to be added to entrypoint.sh.