These are chat archives for coala/coala-bears

27th
Jul 2017
John Vandenberg
@jayvdb
Jul 27 2017 05:01
corobo file issue coala-bears RST bears should support Sphinx prolog and epilog
http://www.sphinx-doc.org/en/stable/config.html#confval-rst_epilog
restructuredtext_lint 1.1.0 has added support for this; see twolfson/restructuredtext-lint#39.
difficulty/low
corobo
@co-robo
Jul 27 2017 05:01
Here you go: coala/coala-bears#1954
Naveen Tata
@naveentata
Jul 27 2017 12:23

Hey, Currently I am writing MarkdownfmtBear(my first bear)
coala/coala-bears#1896 ,I wrote a test file with good and bad files but It is showing some errors while building

_______________________ MarkdownfmtBear.test_valid_files _______________________

self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_valid_files>

    def test_valid_files(self):

        self.assertIsInstance(valid_files, (list, tuple))

        for file in valid_files:

            self.check_validity(self.uut,

                                file.splitlines(keepends=True),

                                filename,

                                valid=True,

                                force_linebreaks=force_linebreaks,

                                create_tempfile=create_tempfile,

>                               tempfile_kwargs=tempfile_kwargs)

../../../virtualenv/python3.6.1/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:306: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

../../../virtualenv/python3.6.1/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:100: in check_validity

    settings=settings,

../../../virtualenv/python3.6.1/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:207: in check_results

    self.assertEqual(bear_output, results, msg=msg)

E   AssertionError: Lists differ: [<Result object(id=0xbc45abefe07042b98c3e1[614 chars]1d0>] != []

E   

E   First list contains 1 additional elements.

E   First extra element 0:

E   <Result object(id=0xbc45abefe07042b98c3e1b0e56601048, origin='MarkdownfmtBear', affected_code=(<SourceRange object(start=<SourcePosition object(file='/tmp/tmpogns7_ou', line=1, column=None) at 0x7f32a5fe17f0>, end=<SourcePosition object(file='/tmp/tmpogns7_ou', line=1, column=None) at 0x7f32a5fe1160>) at 0x7f32a5fe1cc0>, <SourceRange object(start=<SourcePosition object(file='/tmp/tmpogns7_ou', line=3, column=None) at 0x7f32a5fe1908>, end=<SourcePosition object(file='/tmp/tmpogns7_ou', line=4, column=None) at 0x7f32a5fe10f0>) at 0x7f32a5fe1e80>), severity=NORMAL, confidence=100, message='Formatting can be improved.', aspect=NoneType) at 0x7f32a5fe11d0>

E   

E   Diff is 669 characters long. Set self.maxDiff to None to see it. : The local bear 'MarkdownfmtBear' yields a result although it shouldn't.

I am not able to understand it, Can anyone help me in this? :worried:

Niklas
@NiklasMM
Jul 27 2017 12:45
self.assertEqual(bear_output, results, msg=msg)
that assertion is violated
because the bear yields a result where none is expected
Naveen Tata
@naveentata
Jul 27 2017 13:08
@NiklasMM Thanks, I will try to solve it :smile: