Skip to content
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

Merged
merged 1 commit into from Aug 2, 2017
Merged

Conversation

@yash-nisar
Copy link
Member

@yash-nisar yash-nisar commented Jul 31, 2017

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

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    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:

The more you review, the more your score will grow at coala.io and we will
review your PRs faster!

@yash-nisar
Copy link
Member Author

@yash-nisar yash-nisar commented Jul 31, 2017

@yash-nisar yash-nisar force-pushed the yash-nisar:httpolice branch 2 times, most recently from 326dd15 to 3988b72 Jul 31, 2017

severity_map = {'E': RESULT_SEVERITY.MAJOR,
'C': RESULT_SEVERITY.NORMAL,
'D': RESULT_SEVERITY.INFO}

This comment has been minimized.

@Makman2

Makman2 Jul 31, 2017
Member

you have to provide this at @linter, not here^^

This comment has been minimized.

@yash-nisar

yash-nisar Aug 1, 2017
Author Member

Ohh, I've seen this mapping outside the decorator in many bears. Nvm will raise an issue 😉

def create_arguments(filename, file, config_file,
silent: typed_list(str)=[]):
"""
:param silent:

This comment has been minimized.

@Makman2

Makman2 Jul 31, 2017
Member

hmm the name silent is very general, maybe you can make it more precise?

silent: typed_list(str)=[]):
"""
:param silent:
Silences the given list of notice IDs.

This comment has been minimized.

@Makman2

Makman2 Jul 31, 2017
Member

is there a sensible default list?

This comment has been minimized.

@yash-nisar

yash-nisar Aug 1, 2017
Author Member

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.",

This comment has been minimized.

@Makman2

Makman2 Jul 31, 2017
Member

do you maybe have at least one real HAR file?

This comment has been minimized.

@yash-nisar

yash-nisar Aug 1, 2017
Author Member

Yes, I have collected a real valid HAR file manually, will update the tests.

This comment has been minimized.

@yash-nisar

yash-nisar Aug 1, 2017
Author Member

test_valid_file has a real HAR file 😄

@yash-nisar yash-nisar force-pushed the yash-nisar:httpolice branch 2 times, most recently from 3fed145 to c56888c Aug 1, 2017
@yash-nisar
Copy link
Member Author

@yash-nisar yash-nisar commented Aug 1, 2017

@Makman2 Updated.

def create_arguments(filename, file, config_file,
silence_ids: typed_list(str)=[]):
"""
:param silence_ids:

This comment has been minimized.

@Makman2

Makman2 Aug 1, 2017
Member

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 👍)

silence_ids: typed_list(str)=[]):
"""
:param silence_ids:
Silences the given list of notice IDs.

This comment has been minimized.

@Makman2

Makman2 Aug 1, 2017
Member

The documentation shall also state that these IDs are defined by HTTPolice, so people know where to lookup those 👍

Closes #596
@yash-nisar yash-nisar force-pushed the yash-nisar:httpolice branch from c56888c to 40dd5d4 Aug 2, 2017
@yash-nisar
Copy link
Member Author

@yash-nisar yash-nisar commented Aug 2, 2017

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.

This comment has been minimized.

@Makman2

Makman2 Aug 2, 2017
Member

since it's RST, is a special syntax required for links?

This comment has been minimized.

@Makman2

Makman2 Aug 2, 2017
Member

no it works fine :)

@Makman2
Copy link
Member

@Makman2 Makman2 commented Aug 2, 2017

ack 40dd5d4

1 similar comment
@Makman2
Copy link
Member

@Makman2 Makman2 commented Aug 2, 2017

ack 40dd5d4

@Makman2
Copy link
Member

@Makman2 Makman2 commented Aug 2, 2017

@rultor merge

@rultor
Copy link

@rultor rultor commented Aug 2, 2017

@rultor merge

@Makman2 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 40dd5d4 into coala:master Aug 2, 2017
6 of 8 checks passed
6 of 8 checks passed
ci/circleci CircleCI is running your tests
Details
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
codecov/project 100% (target 100%)
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
review/gitmate/commit No issues with this one - go ahead! :)
Details
review/gitmate/manual This commit was acknowledged.
Details
review/gitmate/pr All is well! :) (0 problems solved)
Details
@yash-nisar yash-nisar deleted the yash-nisar:httpolice branch Aug 2, 2017
@rultor
Copy link

@rultor rultor commented Aug 2, 2017

@rultor merge

@Makman2 Done! FYI, the full log is here (took me 3min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.