diff --git a/README.rst b/README.rst index 2c715a8c..c57e9127 100644 --- a/README.rst +++ b/README.rst @@ -115,6 +115,8 @@ Extra linter parameters - ``--po-lint-enable``: a comma separated list of checks to enable. - ``--po-lint-disable``: a comma separated list of checks to disable. +For rst-syntax-error skip unknown directives + .. _here: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pofilter_tests.html#test-description .. |Build Status| image:: https://travis-ci.org/Vauxoo/pylint-odoo.svg?branch=master diff --git a/pylint_odoo/checkers/modules_odoo.py b/pylint_odoo/checkers/modules_odoo.py index ac303167..952466b0 100644 --- a/pylint_odoo/checkers/modules_odoo.py +++ b/pylint_odoo/checkers/modules_odoo.py @@ -3,6 +3,7 @@ import ast import os +import re import astroid from pylint.checkers import utils @@ -298,9 +299,20 @@ def _check_rst_syntax_error(self): errors = self.check_rst_syntax( os.path.join(self.module_path, rst_file)) for error in errors: + msg = error.full_message + res = re.search( + r'No directive entry for "([\w|\-]+)"|' + r'Unknown directive type "([\w|\-]+)"|' + r'No role entry for "([\w|\-]+)"|' + r'Unknown interpreted text role "([\w|\-]+)"', msg) + # TODO: Add support for sphinx directives after fix + # https://github.com/twolfson/restructuredtext-lint/issues/29 + if res: + # Skip directive errors + continue self.msg_args.append(( "%s:%d" % (rst_file, error.line), - error.full_message.strip('\n').replace('\n', '|'))) + msg.strip('\n').replace('\n', '|'))) if self.msg_args: return False return True diff --git a/pylint_odoo/test_repo/broken_module2/README.rst b/pylint_odoo/test_repo/broken_module2/README.rst index 81f53ca2..32c658e1 100644 --- a/pylint_odoo/test_repo/broken_module2/README.rst +++ b/pylint_odoo/test_repo/broken_module2/README.rst @@ -2,3 +2,35 @@ Test module 2 ============= This module was written to check the test lint + + +******* +Project +******* + +.. toctree:: + :maxdepth: 1 + + project/contribute + project/contributors + project/license + project/changes + project/roadmap + +***************** +Developer's guide +***************** + +.. toctree:: + :maxdepth: 2 + + guides/concepts.rst + guides/code_overview.rst + +****************** +Indices and tables +****************** + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search`