BUPT / magic-mirror

Magic Mirror - 魔镜
https://docs.google.com/presentation/d/12I5k_lhlEyipIdHq270JzEFA8WH5B4VPZKnmjj1YHJs/edit?usp=sharing
Apache License 2.0
17 stars 8 forks source link

Add a python linting testing for our repository #33

Open huan opened 5 years ago

huan commented 5 years ago

It is very important to keep the coding style of the whole codebase to be consistent through all the team members because it will help us to read the code more easily.

To be added to the CI.

Duan-JM commented 5 years ago

I am using flake8 for now. Below is my config refer to the pytorch python linting.

  1. Install

    pip3 install flake8 flake8-mypy flake8-bugbear flake8-comprehensions flake8-executable flake8-pyi mccabe pycodestyle pyflakes
  2. .flake8 file

    [flake8]
    select = B,C,E,F,P,T4,W,B9
    max-line-length = 120
    # C408 ignored because we like the dict keyword argument syntax
    # E501 is not flexible enough, we're using B950 instead
    ignore =
    E203,E305,E402,E501,E721,E741,F403,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,
    # these ignores are from flake8-bugbear; please fix!
    B007,B008,
    # these ignores are from flake8-comprehensions; please fix!
    C400,C401,C402,C403,C404,C405,C407,C411,
    per-file-ignores = __init__.py: F401
    exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,torch/lib/include,torch/lib/tmp_install,build,torch/include,*.pyi,.git
Duan-JM commented 5 years ago

I tried to add this repo to Travis CI, sadly and found that I don't have enough rights to enable this repo on Travis. Maybe it is great to enable the CI by the owner, and we just modify the .travis.yaml to configure the CI. And also it will be appreciated to give a hint on how to check the availability to the repo, which does not belong to me.


I did my efforts under the following steps:

  1. Log into the Travis from the official website here with my GitHub account.
  2. Choose the magic-mirror under the organize BUPT.
  3. Try to check if repo have enabled the CI. (Failed)
    • I could only check the availability for my own repo. (No insufficient rights)
    • I tried to google How to check the availability to the CI, but no useful information get.
huan commented 5 years ago

Yes, it seems that only the repo owner can enable it.

I'll try to make it work later, please get your configure file ready to go!

Duan-JM commented 5 years ago

Okay I will get it ready recently. 

huan commented 5 years ago

I believe it's ready to go now:

image

Duan-JM commented 5 years ago

Awesome, so happy to see that, the file will be ready to go recently.