-
Notifications
You must be signed in to change notification settings - Fork 36
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
[bug 1101253] Add flake8 check to travis. #85
Conversation
575fa1d
to
f506b2f
Compare
Thanks for the PR! Two things though:
I imagine @glogiotatidis will disagree with me because IIRC he's done this to other projects before. :P |
For what it's worth I'm a huge fan of style checks and for me and my projects and I generally believe that style checks should fail tests. I however do see your point as I imagine that sometimes snippets (and fixes to existing snippets) need to be pushed through before a certain date. Would failing test runs on style check fails for the snippets-service make still sense though since I'm guessing pushing stuff through isn't as important/time sensitive? |
I'd like to wait and see how possible this is before making a decision, as well as waiting for @glogiotatidis 's input. :D |
This last commit is also an option but unfortunately travis doesn't be able to give back |
I like it! Seems like most of the errors are line length. Is there any way to set the maximum line length to 100? Alternatively, can we ignore that specific error type? |
34c5f6f
to
d730ec8
Compare
@Osmose As you wish :) |
I like respecting pep8 but I understand what @Osmose means when he says that "There are plenty of good reasons to break PEP8". I like what you've done here @koddsson, it's a win-win. Having a jenkins (or other service) to comment on PRs with pep8 warnings would be ideal, because otherwise you'll have to take action to see if there are any warnings. I used to work on imhotep and flake8 plugin. If that sounds interesting we can revive it. Thanks @koddsson! |
This is just what I was thinking, if you need to go to travis for each build to check the linter nobody is going to realistically gonna do it (unless the owners remember to do so for every PR)
I like it! To me the most ideal situation would have travis comment on the with warnings on PRs much like how coveralls.io does is but that doesn't seem to be an option. |
I was in the shower this morning and thinking to myself that I could probably write some small app in python/bash that I could execute on travis that would comment on the PR with the flake8 results. I'm looking into that possibility now and I might use this PR to test it so it might get noisy in here. |
e5ef8c3
to
6618604
Compare
I actually went on and wrote a little script that does this with a GitHub API token key and a new dummy user @mozilla-travis, but it seems not possible without exposing the token to the world since travis won't let PRs get access to secure variables. Would that be such a bad idea? (I'm just thinking out loud here). Since @mozilla-travis is just a dummy account with no access to anything would it be so bad if someone had it's token key? What do you guys think? @Osmose @glogiotatidis |
I don't see any huge issue myself. I'll take a look at the code tomorrow or Monday. |
6618604
to
4743ee8
Compare
|
Ok, I added the token in cleartext (I can always revoke it), commit that and that triggered a build on travis which triggered @mozilla-travis to comment here with the PEP8 errors. |
- python manage.py test | ||
env: | ||
global: | ||
- GITHUB_TOKEN=032783628529705aa6c4a3c79610b0fa593fed21 |
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 name this TRAVIS_BOT_GITHUB_TOKEN
just to be explicit?
r+wc, the two comments are nits. Really nice job on this, I'll totally be using this in other projects. :D Let me know when you've updated the PR and I'll merge. |
I'm glad to hear you say that, I was actually thinking about abstracting this into a pypi package so that other people can use this! After I'm done with that I'll probably come back here and refactor this to use that package. |
8002d15
to
8fe1f07
Compare
Hmm.. Seemed to break after my last commit. |
8fe1f07
to
1affa00
Compare
|
Yess! I think we're ready @Osmose! |
Merged in c707e13...8b4bcb0. Great work! |
flake8 all the things!