-
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
HTMLLintBear: Add settings for individual features #1304
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.
As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well! |
invalid_files=(), | ||
settings={'optional_tag': 'off'}, | ||
tempfile_kwargs={'suffix': '.html'}) | ||
|
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.
W391 blank line at end of file'
PycodestyleBear (W391), severity NORMAL, section autopep8
.
invalid_files=(), | ||
settings={'optional_tag': 'off'}, | ||
tempfile_kwargs={'suffix': '.html'}) | ||
|
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.
The code does not comply to PEP8.
PEP8Bear, severity NORMAL, section autopep8
.
The issue can be fixed by applying the following patch:
--- a/tests/hypertext/HTMLLintBearTest.py
+++ b/tests/hypertext/HTMLLintBearTest.py
@@ -34,4 +34,3 @@
invalid_files=(),
settings={'optional_tag': 'off'},
tempfile_kwargs={'suffix': '.html'})
-
3ca3d1b
to
55ce1ea
Compare
HTMLLintBearDisableCheckerTest = verify_local_bear( | ||
HTMLLintBear, | ||
valid_files=(test_file,), | ||
invalid_files=(), |
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 is no invalid_file given?
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.
The invalid_files
are tested in a seperate test.
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.
For all tests we should have at least an valid and an invalid file
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.
The tests before don't follow that. The invalid_files
is already covered in the HTMLLintBearTest
and HTMLLintBearIgnoreQuotationTest
. I feel since HTMLLintBearDisableCheckerTest
is supposed to check whether disabling a certain setting takes effect, it would make no sense to include an invalid_file.
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.
@pratyushprakash How does this test check whether disabling a certain setting takes effect.
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.
@namanyadav12 could you please view HTMLLintBearTest.py in its entirety and not just the changes I made
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.
Imo testing on this bear is a bit screwy and needs to be improved. This would be separate issue. Ideally we test most of these options, but not possible right now. However since we are trying to improve tests, it would be nice if you verified that the bear was outputting the correct error.
@namanyadav12 What exactly do you want changed ? |
HTMLLintBear, | ||
valid_files=(test_file,), | ||
invalid_files=(), | ||
settings={'optional_tag': 'off'}, |
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.
can you add a test with an invalid tag ?
html-lint handles it so we need just to check we are good with that.
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.
Well apparently html-lint does not check for invalid tags.
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.
I think it does see https://github.com/sk-/html-linter/blob/master/html_linter.py#L1083 ..
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.
That peice of code is actually informing the user that they provided invalid disable arguments.
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.
yeah, sorry by tag earlier I was referring to disable argument. damn. >_<
@@ -28,9 +28,95 @@ class HTMLLintBear: | |||
|
|||
@staticmethod | |||
def create_arguments(filename, file, config_file, | |||
doctype: str='Enable', | |||
entities: str='Enable', | |||
trailing_whitespace: str='Enable', |
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.
most of the settings start with either allow
or enable
or force
... you should consider using that convention, and particularly for this setting we use allow_trailing_whitespaces
[use git grep to check ]
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.
And the settings are of type bool
if they are true/false type flags.
Settings have been added for enabling/disabling indidual features of the `html_linter`. Closes coala#1247
55ce1ea
to
120ad55
Compare
@@ -28,9 +28,101 @@ class HTMLLintBear: | |||
|
|||
@staticmethod | |||
def create_arguments(filename, file, config_file, | |||
enable_doctype: bool=True, | |||
enable_entities: bool=True, | |||
enable_trailing_whitespace: bool=True, |
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.
use allow_trailing_whitespace
for consistency
enable_doctype: bool=True, | ||
enable_entities: bool=True, | ||
enable_trailing_whitespace: bool=True, | ||
enable_tabs: bool=True, |
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.
either use_tabs: bool=True
or use_spaces: bool=False
@@ -28,9 +28,101 @@ class HTMLLintBear: | |||
|
|||
@staticmethod | |||
def create_arguments(filename, file, config_file, | |||
enable_doctype: bool=True, |
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.
what about check_doctype
? 😅
htmllint_ignore: typed_list(str)=()): | ||
""" | ||
:param htmllint_ignore: List of checkers to ignore. | ||
:param enable_doctype: | ||
Enable or disable doctype checker. |
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.
maybe you should add an example here, it is not quite clear what this setting does
:param enable_doctype: | ||
Enable or disable doctype checker. | ||
:param enable_entities: | ||
Enable or disable unicode entity checker. |
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.
here too...
:param enable_extra_whitespace: | ||
Enable or disable checker for extra whitespace. | ||
:param htmllint_ignore: | ||
List of checkers to ignore. |
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.
i feel like, you should instead tell what the setting do instead of telling what is enabled or disabled
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
8 similar comments
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
9 similar comments
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Enable or disable unicode entity checker. | ||
:param enable_trailing_whitespace: | ||
Enable or disable checker for trailing whitespace. | ||
:param enable_tabs: |
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.
this should be use_spaces
to be consistent with other bears. I've raised that as a separate issue #1741 , which you are welcome to mark as solved in this PR , but it is kind of urgent.
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
9 similar comments
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Settings have been added for enabling/disabling indidual
features of the
html_linter
.Closes #1247