-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LatexLintBear.py: Fix formatting error #2399
base: master
Are you sure you want to change the base?
Conversation
7f7696f
to
0e66d7b
Compare
tests/latex/LatexLintBearTest.py
Outdated
@@ -17,3 +21,15 @@ | |||
LatexLintBearTest = verify_local_bear(LatexLintBear, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you put it inside LatexBearTest class? 😉 Then you don't need to import verify_local_bear anymore.
0e66d7b
to
d4111fb
Compare
tests/latex/LatexLintBearTest.py
Outdated
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
from coalib.testing.LocalBearTestHelper import LocalBearTestHelper | ||
from coalib.testing.BearTestHelper import generate_skip_decorator | ||
from bears.latex.LatexLintBear import LatexLintBear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we keep all these in alphabetical order.
This removes the extra !n from the messages generated by LatexLintBear and add a test to check it. Fixes coala#1876
d4111fb
to
f06a8a3
Compare
self.check_validity(self.uut, ['{.}', '{ sometext }']) | ||
self.check_invalidity(self.uut, ['{ .}', '{ sometext }']) | ||
results = self.check_invalidity(self.uut, ['2018-12-01']) | ||
self.assertEqual('Wrong length of dash may have been used.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? IMO, check_invalidity(...)
can detect if it is giving any type of error message. So, don't need to use assertEqual(...)
here.
Check second last line here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sangamcse I wanted to test result, which show that I properly corrected bug from issue (This was mentioned in issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. But this message is not matching with the --format
given in create_arguments(...)
. Am I missing something? 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohk. Got it. NM 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this was about a newline marker, which is mostly needed if there are multiple errors/warnings/etc, please add a test where there are two messages emitted by chktex
, and verify both messages are correctly extracted from the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayvdb I have following problem : When I created such file to test as below, then only first error was passed to messages in results. I saw the same behaviour when I run coala -b LatexLintBear --files=test.tex on actual version available for user.
2018-12-01
Let $t\in[0,\infty)$.
In my opinion here should be two messages : "Wrong length of dash may have been used." and "Number of [' doesn't match the number of
]'!"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄
cc @Makman2
@@ -22,6 +22,6 @@ class LatexLintBear: | |||
def create_arguments(filename, file, config_file): | |||
return ( | |||
'--format', | |||
'%k %n in {0} line %l: %m!n'.format(filename), | |||
'%k %n in {0} line %l: %m'.format(filename), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. the !n
was added by me while fixing #317
It translates to newline, but I am not 100% sure it was necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, !n
isnt working.
Another approach is to use -v0
self.check_validity(self.uut, ['{.}', '{ sometext }']) | ||
self.check_invalidity(self.uut, ['{ .}', '{ sometext }']) | ||
results = self.check_invalidity(self.uut, ['2018-12-01']) | ||
self.assertEqual('Wrong length of dash may have been used.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this was about a newline marker, which is mostly needed if there are multiple errors/warnings/etc, please add a test where there are two messages emitted by chktex
, and verify both messages are correctly extracted from the output.
This removes the extra !n from the messages generated
by LatexLintBear and add a test to check it.
Fixes #1876
For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!
Checklist
them.
individually. It is not sufficient to have "fixup commits" on your PR,
our bot will still report the issues for the previous commit.) You will
likely receive a lot of bot comments and build failures if coala does not
pass on every single commit!
After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.
Please consider helping us by reviewing other peoples pull requests as well:
corobo mark wip <URL>
to get it outof the review queue.
The more you review, the more your score will grow at coala.io and we will
review your PRs faster!