Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (35 commits)
  rename readme section to add FAQ
  whitespace
  add known limitations section; rstcheck#97
  whitespace
  cli args take precedence over config files; fixes rstcheck#96
  state config file hierarchy; rstcheck#96
  update changelog
  change back to code-block b/c of sphinx context
  guard directive remove actions
  remove cli option for sphinx defaults
  remove unused noqa
  allow code blocks to be ignored; fixes rstcheck#79
  fix types
  prewrap test resuls in dict for better introspection
  overwrite code-block and sourcecode directives without sphinx again
  remove code and code-block from sphinx ignore list
  load directives and roles from sphinx's docutils
  update extended default sphinx directives and roles
  drop sphinx default values
  add code-block to sphinx ignore roles
  ...
  • Loading branch information
weibullguy committed Apr 18, 2022
2 parents 583d5c3 + e989abf commit d4c440c
Show file tree
Hide file tree
Showing 18 changed files with 297 additions and 246 deletions.
31 changes: 30 additions & 1 deletion README.rst
Expand Up @@ -165,6 +165,10 @@ local configuration file of the project (just replace ``-`` for ``_``).
``pyproject.toml`` in the directory or ancestor directories of the file it is
checking.

``.rstcheck.cfg`` takes precedence over ``setup.cfg``.

Settings in the config file are overwritten by CLI options.

For example, consider a project with the following directory structure

.. code:: text
Expand Down Expand Up @@ -259,7 +263,7 @@ constraint is >=4.0 because of Sphinx's open upper constraints on jinja2 and mar
which result in import errors if not pinned below version 3 and 2 respectively. This happend
in Sphinx version 4.0.

You can also add Sphinx by yourself but the installed Sphinx version must be at least 1.5.
You can also add Sphinx by yourself but the installed Sphinx version must be at least 2.0.

To check that Sphinx support is enabled

Expand Down Expand Up @@ -288,6 +292,7 @@ Just install ``rstcheck`` and make sure is on your path.
.. _Syntastic: https://github.com/scrooloose/syntastic
.. _ALE: https://github.com/w0rp/ale


Use as a module
===============

Expand Down Expand Up @@ -378,13 +383,36 @@ To run all the tests you have three options
$ tox
Known limitations / FAQ
=======================

There are inherent limitations to what ``rstcheck`` can and cannot do. The reason for this is that
``rstcheck`` itself does not parse the rst source but gives it to ``docutils`` and gets the errors
back. Therefore rstcheck in the sense of rst source is more an error accumulation tool. The same
goes for the source code in supported code blocks.


History
=======


(next version)
--------------

- Fix inability to ignore ``code``, ``code-block`` and ``sourcecode`` directives (#79)
- Fix ``code-block`` options recognition (#62)
- Add section with ``Known limitations / FAQ`` to the README (#97)


.. _beaking_changes_v6:

BREAKING CHANGES
~~~~~~~~~~~~~~~~

- Drop support for sphinx < 2.0
- Drop default values for directves and roles for sphinx (#65)
- CLI options now take precedence over config file options (#96)


5.0.0 (2022-04-17)
------------------
Expand All @@ -394,6 +422,7 @@ History
- Add ``Mega-Linter`` section to README
- Add ``BREAKING CHANGES`` sections to changelog


.. _beaking_changes_v5:

BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion examples/bad/bad_bash.rst
Expand Up @@ -2,6 +2,6 @@
Test
====

.. code-block:: bash
.. code:: bash
{
2 changes: 0 additions & 2 deletions examples/bad/bad_code.rst
Expand Up @@ -2,8 +2,6 @@
Test
====

``code`` rather than ``code-block``.

.. code:: python
print(
2 changes: 1 addition & 1 deletion examples/bad/bad_cpp.rst
Expand Up @@ -2,7 +2,7 @@
Test
====

.. code-block:: cpp
.. code:: cpp
int main()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/bad/bad_python.rst
Expand Up @@ -2,6 +2,6 @@
Test
====

.. code-block:: python
.. code:: python
print(
2 changes: 1 addition & 1 deletion examples/bad/bad_rst_in_rst.rst
Expand Up @@ -2,7 +2,7 @@
Test
====

.. code-block:: rst
.. code:: rst
Testing
===
40 changes: 20 additions & 20 deletions examples/good/good.rst
Expand Up @@ -2,14 +2,14 @@
Test
====

.. code-block:: bash
.. code:: bash
if [ "$x" == 'y' ]
then
exit 1
fi
.. code-block:: c
.. code:: c
float foo(int n)
{
Expand All @@ -19,7 +19,7 @@ Test
return x[0];
}
.. code-block:: cpp
.. code:: cpp
#include <iostream>
Expand All @@ -29,20 +29,20 @@ Test
return x;
}
.. code-block:: python
.. code:: python
print(1)
Run more tests for checking performance.

.. code-block:: bash
.. code:: bash
if [ "$x" == 'y' ]
then
exit 1
fi
.. code-block:: c
.. code:: c
float foo(int n)
{
Expand All @@ -52,7 +52,7 @@ Run more tests for checking performance.
return x[0];
}
.. code-block:: cpp
.. code:: cpp
#include <iostream>
Expand All @@ -62,18 +62,18 @@ Run more tests for checking performance.
return x;
}
.. code-block:: python
.. code:: python
print(1)
.. code-block:: bash
.. code:: bash
if [ "$x" == 'y' ]
then
exit 1
fi
.. code-block:: c
.. code:: c
float foo(int n)
{
Expand All @@ -83,7 +83,7 @@ Run more tests for checking performance.
return x[0];
}
.. code-block:: cpp
.. code:: cpp
#include <iostream>
Expand All @@ -93,18 +93,18 @@ Run more tests for checking performance.
return x;
}
.. code-block:: python
.. code:: python
print(1)
.. code-block:: bash
.. code:: bash
if [ "$x" == 'y' ]
then
exit 1
fi
.. code-block:: c
.. code:: c
float foo(int n)
{
Expand All @@ -114,7 +114,7 @@ Run more tests for checking performance.
return x[0];
}
.. code-block:: cpp
.. code:: cpp
#include <iostream>
Expand All @@ -124,18 +124,18 @@ Run more tests for checking performance.
return x;
}
.. code-block:: python
.. code:: python
print(1)
.. code-block:: bash
.. code:: bash
if [ "$x" == 'y' ]
then
exit 1
fi
.. code-block:: c
.. code:: c
float foo(int n)
{
Expand All @@ -145,7 +145,7 @@ Run more tests for checking performance.
return x[0];
}
.. code-block:: cpp
.. code:: cpp
#include <iostream>
Expand All @@ -155,7 +155,7 @@ Run more tests for checking performance.
return x;
}
.. code-block:: python
.. code:: python
# ¬∆˚ß∂ƒß∂ƒ˚¬∆
print(1)
2 changes: 1 addition & 1 deletion examples/good/good_cpp_with_local_include.rst
Expand Up @@ -2,7 +2,7 @@
Test
====

.. code-block:: cpp
.. code:: cpp
#include "foo.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/good/good_markdown.rst
Expand Up @@ -2,6 +2,6 @@
Test
====

.. code-block:: markdown
.. code:: markdown
[Markdown-style Link](https://www.example.com/)
4 changes: 2 additions & 2 deletions examples/good/unicode.rst
Expand Up @@ -2,11 +2,11 @@
Тест
====

.. code-block:: python
.. code:: python
print("Привет!")
.. code-block:: bash
.. code:: bash
$ echo 'Привет' >> pipe.txt
$ echo 'файловая труба!' >> pipe.txt
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/with_configuration/bad.rst
Expand Up @@ -3,7 +3,7 @@

:some-custom-thing:`testing`

.. code-block:: cpp
.. code:: cpp
int main()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/with_configuration/good.rst
Expand Up @@ -3,7 +3,7 @@

:some-custom-thing:`testing`

.. code-block:: cpp
.. code:: cpp
int main()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/without_configuration/good.rst
Expand Up @@ -3,7 +3,7 @@

:some-custom-thing:`testing`

.. code-block:: cpp
.. code:: cpp
int main()
{
Expand Down

0 comments on commit d4c440c

Please sign in to comment.