Because `setup.py` is deprecated, let's switch from:
python setup.py build_sphinx
to:
make -C docs html
to build Sphinx documentation.
The generated HTML files in `docs/_build/html` are exactly the same (I
compared with `diff -qr`).
Also add `-W` (turn warnings into errors) to the `sphinx-build` options
to keep the previous behavior.
According to the YAML specification [^1]:
- > It is an error for an alias node to use an anchor that does not
> previously occur in the document.
The `forbid-undeclared-aliases` option checks that aliases do have a
matching anchor declared previously in the document. Since this is
required by the YAML spec, this option is enabled by default.
- > The alias refers to the most recent preceding node having the same
> anchor.
This means that having a same anchor repeated in a document is
allowed. However users could want to avoid this, so the new option
`forbid-duplicated-anchors` allows that. It's disabled by default.
- > It is not an error to specify an anchor that is not used by any
> alias node.
This means that it's OK to declare anchors but don't have any alias
referencing them. However users could want to avoid this, so a new
option (e.g. `forbid-unused-anchors`) could be implemented in the
future. See https://github.com/adrienverge/yamllint/pull/537.
Fixes#395Closes#420
[^1]: https://yaml.org/spec/1.2.2/#71-alias-nodes
rstcheck succeeds with a failure (heh) when there's a code block without
a language specified. This can lead to false negatives as the file is no
longer being checked by rstcheck.
Error:
An `AttributeError` error occured. This is most propably due to a
code block directive (code/code-block/sourcecode) without a
specified language. This may result in a false negative for source:
'docs/disable_with_comments.rst'. See
https://rstcheck-core.readthedocs.io/en/latest/faq/#code-blocks-without-language-sphinx
for more information. Success! No issues detected.
This problem was just introduced by commit cec4f33 "Clarify disable-line
and parser errors, workaround" and produced this error when building
documentation:
docs/disable_with_comments.rst:120:Could not lex literal_block as
"yaml". Highlighting skipped.
The `# -*- coding: utf-8 -*-` headers were useful for Python 2, and
aren't needed for Python 3 where UTF-8 is the default.
yamllint support of Python 2 was dropped in early 2021, see commit
a3fc64d "End support for Python 2".
Let's drop these headers.
Set the 'description' attribute so that Sphinx builds the manpage with
the 'NAME' section. This is necessary for `apropos` to be able to find
yamllint
Fixes part of #76