Skip to content

Linting ReStructuredText fails with rst2html not found even though it is in $PATH #1102

@jaleesacordaro

Description

@jaleesacordaro

Check for existing issues

  • Completed

Environment

vale version 3.14.1

Describe the bug / provide steps to reproduce it

vale and vale-ls fail to lint my rst document claiming rst2html is not found, even though it is in $PATH:

$ vale test.rst
E100 [lintRST] Runtime error

rst2html not found

Execution stopped with code 1.

$ rst2html --help
[lots of help]

More interestingly, this works:

$ PATH=$PATH:/path/to/python vale test.rst

To reproduce, remove the directory containing python, py, etc. from $PATH but keep rst2html in $PATH.
Then run vale some.rst.

The culprit seems to be this check:

rst2html := system.Which([]string{
"rst2html", "rst2html.py", "rst2html-3", "rst2html-3.py"})
python := system.Which([]string{
"python", "py", "python.exe", "python3", "python3.exe", "py3"})
if rst2html == "" || python == "" {
return core.NewE100("lintRST", errors.New("rst2html not found"))
}

I don't speak Go but to me it seems that python is never used.
It is passed here

html, err = callRst(s, rst2html, python)

But seems to be ignored here:

func callRst(text, lib, _ string) (string, error) {

So my suggestion would be to delete the check for python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions