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

Add a python linting testing for our repository #33

Open
huan opened this issue Nov 18, 2019 · 6 comments
Open

Add a python linting testing for our repository #33

huan opened this issue Nov 18, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@huan
Copy link
Contributor

huan commented Nov 18, 2019

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.

@huan huan added the enhancement New feature or request label Nov 18, 2019
@Duan-JM
Copy link
Contributor

Duan-JM commented Nov 20, 2019

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
  1. .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
Copy link
Contributor

Duan-JM commented Nov 28, 2019

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
Copy link
Contributor Author

huan commented Nov 28, 2019

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
Copy link
Contributor

Duan-JM commented Nov 28, 2019 via email

@huan
Copy link
Contributor Author

huan commented Nov 28, 2019

I believe it's ready to go now:

image

@Duan-JM
Copy link
Contributor

Duan-JM commented Nov 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants