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
bears/hypertext: Add HTTPoliceLintBear.py #1962
Conversation
CC @Makman2 |
326dd15
to
3988b72
Compare
bears/hypertext/HTTPoliceLintBear.py
Outdated
|
||
severity_map = {'E': RESULT_SEVERITY.MAJOR, | ||
'C': RESULT_SEVERITY.NORMAL, | ||
'D': RESULT_SEVERITY.INFO} |
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.
you have to provide this at @linter
, not 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.
Ohh, I've seen this mapping outside the decorator in many bears. Nvm will raise an issue
bears/hypertext/HTTPoliceLintBear.py
Outdated
def create_arguments(filename, file, config_file, | ||
silent: typed_list(str)=[]): | ||
""" | ||
:param silent: |
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 name silent
is very general, maybe you can make it more precise?
bears/hypertext/HTTPoliceLintBear.py
Outdated
silent: typed_list(str)=[]): | ||
""" | ||
:param silent: | ||
Silences the given list of notice IDs. |
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.
is there a sensible default list?
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.
Couldn't find one. Completely depends on the user IMO.
@@ -0,0 +1,37 @@ | |||
{ | |||
"_warning": "This is not a real HAR file! It only contains the keys that are interesting to HTTPolice. Please do not use this as an example of a valid HAR 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.
do you maybe have at least one real HAR 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.
Yes, I have collected a real valid HAR file manually, will update the tests.
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.
test_valid_file
has a real HAR
file
3fed145
to
c56888c
Compare
@Makman2 Updated. |
bears/hypertext/HTTPoliceLintBear.py
Outdated
def create_arguments(filename, file, config_file, | ||
silence_ids: typed_list(str)=[]): | ||
""" | ||
:param silence_ids: |
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 actually meant to name the setting to something "HTTPolice" related ;)
The concept of silencing ids is not uncommon for other linters too, so we should disambiguate :)
E.g. silence_httpolice_ids
(maybe look out for other linters that have also ids you can silence (I think BanditBear
has this too), and try to adapt the naming scheme
bears/hypertext/HTTPoliceLintBear.py
Outdated
silence_ids: typed_list(str)=[]): | ||
""" | ||
:param silence_ids: | ||
Silences the given list of notice IDs. |
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 documentation shall also state that these IDs are defined by HTTPolice, so people know where to lookup those
Updated @Makman2 |
:param httpolice_silence_ids: | ||
Silences the given list of notice IDs. You can get more information | ||
about the available notices and their IDs at | ||
https://httpolice.readthedocs.io/en/stable/notices.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.
since it's RST, is a special syntax required for links?
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.
no it works fine :)
ack 40dd5d4 |
1 similar comment
ack 40dd5d4 |
@rultor merge |
Closes #596
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:
cobot 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!