Skip to content

Disable docs-lint in ReadTheDocs config when building for non-English #20

@freakboy3742

Description

@freakboy3742

What is the problem or limitation you are having?

The current ReadTheDocs configuration runs tox -e docs-lint on every build. This is an unnecessary safety check, as nothing language specific is linted, and the spelling and link checker take some time.

Describe the solution you'd like

Performing a non-EN build on Read the Docs should not trigger the linting pre-build step.

This could done be by modifying the RTD configuration to make the docs-lint rule conditional.

RTD command syntax is bash; so re-writing the pre-build rule as:

if [ "$READTHEDOCS_LANGUAGE" == en ]; then python -m tox -e docs-lint; else echo "No linting required"; fi

will likely be sufficient. It might be possible to write this on multiple lines (i.e., actually indented code, rather than using semicolons) by using | syntax in the YAML configuration. The syntax should be similar to this definition used by GitHub Actions.

Describe alternatives you've considered

An alternative approach would be to modify the Tox configuration so that if it is built in an environment where $READTHEDOCS_LANGUAGE is set, and has a value other than en, linting is a no-op. However, this means RTD specifics would leak into the Tox configuration.

Additional context

This isn't a critical problem - the pre-build step is just unnecessary on non-english builds, which means RTD concurrency is being consumed on tasks where it isn't strictly required.

The test for this is to submit the PR, and then observe the RTD build logs to conform that the docs-lint step doesn't run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions