Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
- id: sphinx-lint
name: Sphinx lint
name: Sphinx Lint
description: 'Searches for common typos in sphinx-flavored rst files.'
files: '\.rst$'
# Defer to pre-commit on the best way to delegate resources across available cores
args: [--jobs=1]
entry: sphinx-lint
language: python

12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CPython](https://github.com/python/cpython/blob/e0433c1e7/Doc/tools/rstlint.py).

## What is Sphinx Lint, what is it not?

`sphinx-lint` should:
Sphinx Lint should:

- be reasonably fast so it's comfortable to use as a linter in your editor.
- be usable on a single file.
Expand All @@ -23,7 +23,7 @@ CPython](https://github.com/python/cpython/blob/e0433c1e7/Doc/tools/rstlint.py).

## Using Sphinx Lint

To use Sphinx Lint, run:
Here are some example invocationsn of Sphinx Lint from the command line:

```sh
sphinx-lint # check all dirs and files
Expand All @@ -41,17 +41,9 @@ We recommend using a configuration like this:
rev: LATEST_SPHINXLINT_RELEASE_TAG
hooks:
- id: sphinx-lint
args: [--jobs=1]
types: [rst]
```

In particular, note that the `--jobs=1` flag is recommended for use with pre-commit.
By default, Sphinx Lint uses `multiprocessing` to lint multiple files simultaneously,
but this interacts poorly with pre-commit, which also attempts to use multiprocessing,
leading to resource contention. Adding `--jobs=1` tells Sphinx Lint not to use
multiprocessing itself, deferring to pre-commit on the best way to delegate resources
across available cores.


## Known issues

Expand Down