{"action":"created","issue":{"url":"https://api.github.com/repos/pajlada/pajbot/issues/228","repository_url":"https://api.github.com/repos/pajlada/pajbot","labels_url":"https://api.github.com/repos/pajlada/pajbot/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/pajlada/pajbot/issues/228/comments","events_url":"https://api.github.com/repos/pajlada/pajbot/issues/228/events","html_url":"https://github.com/pajlada/pajbot/issues/228","id":139359074,"number":228,"title":"Travis-ci with flake8 / maybe pip cache","user":{"login":"Nacht123","id":15982658,"avatar_url":"https://avatars.githubusercontent.com/u/15982658?v=3","gravatar_id":"","url":"https://api.github.com/users/Nacht123","html_url":"https://github.com/Nacht123","followers_url":"https://api.github.com/users/Nacht123/followers","following_url":"https://api.github.com/users/Nacht123/following{/other_user}","gists_url":"https://api.github.com/users/Nacht123/gists{/gist_id}","starred_url":"https://api.github.com/users/Nacht123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nacht123/subscriptions","organizations_url":"https://api.github.com/users/Nacht123/orgs","repos_url":"https://api.github.com/users/Nacht123/repos","events_url":"https://api.github.com/users/Nacht123/events{/privacy}","received_events_url":"https://api.github.com/users/Nacht123/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pajlada/pajbot/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-08T18:42:55Z","updated_at":"2016-03-08T18:48:53Z","closed_at":null,"body":"## Flake8\r\nto check **new PR** on flake8(pep8 etc) error's like whitespaces etc. (there are errors in eightball.py :8ball: )\r\nI'm not sure **what errors** you want to **use** and what **not**\r\n\r\nignored some codes, because i think you ignore them in your VIM\r\nignored **E731** because there is one error in the code\r\n\r\n```\r\n./main.py:17:1: E402 module level import not at top of file\r\n./pajbot/bot.py:406:13: E731 do not assign a lambda expression, use a def\r\n./pajbot/modules/eightball.py:83:1: W293 blank line contains whitespace\r\n./pajbot/modules/eightball.py:110:1: W293 blank line contains whitespace\r\n./pajbot/modules/eightball.py:112:5: E303 too many blank lines (2)\r\n```\r\n\r\n```\r\n# .flake8 file\r\n[flake8]\r\nexclude = alembic/*,configs/*,install/*,myvenv/*,node_modules/*,pajbot/scripts/*,__pycache__/*,requirements/*,static/*,templates/*,uwsgiconfigs/*,.git/*,userdispatch.py\r\nignore = E123,E126,E127,E128,E302,E501,E731,F401\r\n\r\n# E123 = closing bracket does not match indentation of opening bracket’s line\r\n# E126 = continuation line over-indented for hanging indent\r\n# E127 = continuation line over-indented for visual indent\r\n# E128 = continuation line under-indented for visual indent\r\n# E302 = expected 2 blank lines, found 0\r\n# E501 = line too long (82 > 79 characters)\r\n# E731 = do not assign a lambda expression, use a def\r\n# F401 = module imported but unused\r\n```\r\n\r\n\r\nthere are some **other flake8 plugins** that are maybe **interesting** to use,\r\nbut there would be some errors now in the code :dancer: \r\n\r\n\r\npip install **flake8-import-order** [(pypi)](https://pypi.python.org/pypi/flake8-import-order/) [(github)](https://github.com/public/flake8-import-order)\r\n\r\npip install **flake8-commas** [(pypi)](https://pypi.python.org/pypi/flake8-commas/0.1.1) [(github)](https://github.com/zedlander/flake8-commas/)\r\n\r\npip install **flake8-quotes** [(pypi)](https://pypi.python.org/pypi/flake8-quotes/0.2.4) [(github)](https://github.com/zheller/flake8-quotes/)\r\n\r\npip install **flake8-strict** [(github)](https://github.com/smarkets/flake8-strict)\r\n\r\n## **cache pip**\r\nmaybe use pip cache, because there is always a message for --use-mirror\r\n```\r\nDEPRECATION: --use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.\r\n```\r\n\r\n```\r\n# .travis.yml file\r\n# Travis CI checks for pajbot\r\nlanguage: python\r\nsudo: false\r\ncache: pip\r\n\r\npython:\r\n  - 3.4\r\n\r\nservices:\r\n  - mysql\r\n  - redis-server\r\n\r\nbefore_install:\r\n  - mysql -e \"create database IF NOT EXISTS test;\" -uroot\r\n  - pip install pip flake8 --upgrade\r\n  - flake8\r\n\r\ninstall:\r\n  - pip install -U -r pip-requirements.txt\r\n  - cp ./install/config.example.ini ./config.ini\r\n\r\nscript:\r\n  - cd tests && ./tests.py\r\n```\r\n__or__ something like this not sure what is better\r\n```\r\n# .travis.yml file\r\n# Travis CI checks for pajbot\r\nlanguage: python\r\nsudo: false\r\ncache:\r\n  directories:\r\n    - $HOME/.cache/pip\r\n\r\npython:\r\n  - 3.4\r\n\r\nservices:\r\n  - mysql\r\n  - redis-server\r\n\r\nbefore_install:\r\n  - mysql -e \"create database IF NOT EXISTS test;\" -uroot\r\n  - pip install pip flake8 --upgrade\r\n  - flake8\r\n\r\ninstall:\r\n  - pip install -U -r pip-requirements.txt\r\n  - cp ./install/config.example.ini ./config.ini\r\n\r\nscript:\r\n  - cd tests && ./tests.py\r\n```"},"comment":{"url":"https://api.github.com/repos/pajlada/pajbot/issues/comments/193911935","html_url":"https://github.com/pajlada/pajbot/issues/228#issuecomment-193911935","issue_url":"https://api.github.com/repos/pajlada/pajbot/issues/228","id":193911935,"user":{"login":"pajlada","id":962989,"avatar_url":"https://avatars.githubusercontent.com/u/962989?v=3","gravatar_id":"","url":"https://api.github.com/users/pajlada","html_url":"https://github.com/pajlada","followers_url":"https://api.github.com/users/pajlada/followers","following_url":"https://api.github.com/users/pajlada/following{/other_user}","gists_url":"https://api.github.com/users/pajlada/gists{/gist_id}","starred_url":"https://api.github.com/users/pajlada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pajlada/subscriptions","organizations_url":"https://api.github.com/users/pajlada/orgs","repos_url":"https://api.github.com/users/pajlada/repos","events_url":"https://api.github.com/users/pajlada/events{/privacy}","received_events_url":"https://api.github.com/users/pajlada/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T18:48:52Z","updated_at":"2016-03-08T18:48:52Z","body":"This looks great. Would be awesome to have flake8 checking on PRs\nOn Mar 8, 2016 19:42, \"Nacht123\" <notifications@github.com> wrote:\n\n> Flake8\n>\n> to check *new PR* on flake8(pep8 etc) error's like whitespaces etc.\n> (there are errors in eightball.py [image: :8ball:] )\n> I'm not sure *what errors* you want to *use* and what *not*\n>\n> ignored some codes, because i think you ignore them in your VIM\n> ignored *E731* because there is one error in the code\n>\n> ./main.py:17:1: E402 module level import not at top of file\n> ./pajbot/bot.py:406:13: E731 do not assign a lambda expression, use a def\n> ./pajbot/modules/eightball.py:83:1: W293 blank line contains whitespace\n> ./pajbot/modules/eightball.py:110:1: W293 blank line contains whitespace\n> ./pajbot/modules/eightball.py:112:5: E303 too many blank lines (2)\n>\n> # .flake8 file\n> [flake8]\n> exclude = alembic/*,configs/*,install/*,myvenv/*,node_modules/*,pajbot/scripts/*,__pycache__/*,requirements/*,static/*,templates/*,uwsgiconfigs/*,.git/*,userdispatch.py\n> ignore = E123,E126,E127,E128,E302,E501,E731,F401\n>\n> # E123 = closing bracket does not match indentation of opening bracket’s line\n> # E126 = continuation line over-indented for hanging indent\n> # E127 = continuation line over-indented for visual indent\n> # E128 = continuation line under-indented for visual indent\n> # E302 = expected 2 blank lines, found 0\n> # E501 = line too long (82 > 79 characters)\n> # E731 = do not assign a lambda expression, use a def\n> # F401 = module imported but unused\n>\n> there are some *other flake8 plugins* that are maybe *interesting* to use,\n> but there would be some errors now in the code [image: :dancer:]\n>\n> pip install *flake8-import-order* (pypi)\n> <https://pypi.python.org/pypi/flake8-import-order/> (github)\n> <https://github.com/public/flake8-import-order>\n>\n> pip install *flake8-commas* (pypi)\n> <https://pypi.python.org/pypi/flake8-commas/0.1.1> (github)\n> <https://github.com/zedlander/flake8-commas/>\n>\n> pip install *flake8-quotes* (pypi)\n> <https://pypi.python.org/pypi/flake8-quotes/0.2.4> (github)\n> <https://github.com/zheller/flake8-quotes/>\n>\n> pip install *flake8-strict* (github)\n> <https://github.com/smarkets/flake8-strict>\n> *cache pip*\n>\n> maybe use pip cache, because there is always a message for --use-mirror\n>\n> DEPRECATION: --use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.\n>\n> # .travis.yml file\n> # Travis CI checks for pajbot\n> language: python\n> sudo: false\n> cache: pip\n>\n> python:\n>   - 3.4\n>\n> services:\n>   - mysql\n>   - redis-server\n>\n> before_install:\n>   - mysql -e \"create database IF NOT EXISTS test;\" -uroot\n>   - pip install pip flake8 --upgrade\n>   - flake8\n>\n> install:\n>   - pip install -U -r pip-requirements.txt\n>   - cp ./install/config.example.ini ./config.ini\n>\n> script:\n>   - cd tests && ./tests.py\n>\n> *or* something like this not sure what is better\n>\n> # .travis.yml file\n> # Travis CI checks for pajbot\n> language: python\n> sudo: false\n> cache:\n>   directories:\n>     - $HOME/.cache/pip\n>\n> python:\n>   - 3.4\n>\n> services:\n>   - mysql\n>   - redis-server\n>\n> before_install:\n>   - mysql -e \"create database IF NOT EXISTS test;\" -uroot\n>   - pip install pip flake8 --upgrade\n>   - flake8\n>\n> install:\n>   - pip install -U -r pip-requirements.txt\n>   - cp ./install/config.example.ini ./config.ini\n>\n> script:\n>   - cd tests && ./tests.py\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/pajlada/pajbot/issues/228>.\n>\n"}}