Skip to content

add autopep8 to Contributions guide #852

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

Merged
merged 5 commits into from
Feb 16, 2020
Merged

add autopep8 to Contributions guide #852

merged 5 commits into from
Feb 16, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Feb 15, 2020

What does this PR do?

Fixes #53. Adding usage autopep8 to guidelines

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@Borda
Copy link
Member Author

Borda commented Feb 15, 2020

@hadim ^^ something like this?

@Borda Borda added docs Documentation related feature Is an improvement or enhancement labels Feb 15, 2020
@Borda Borda changed the title add autopep8 to Contributions guide add autopep8 to Contributions guide [wip] Feb 15, 2020
@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

Looks good to me. Thanks!

@Borda Borda changed the title add autopep8 to Contributions guide [wip] add autopep8 to Contributions guide Feb 15, 2020
@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

In my test autopep8 -v --in-place *.py seems to be sufficient since it uses the various configuration files present within the root folder of the repo.

Also running autopep8 -v --in-place *.py brings no modifications on master for me (which means that the code is correctly formatted).

@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

Actually my command is wrong since it does not process the files... doing more tests now.

@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

Here is the correct command: autopep8 -v -r --in-place .

@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

Running it on master modify 3 files:

        modified:   pytorch_lightning/loggers/comet.py
        modified:   pytorch_lightning/loggers/neptune.py
        modified:   pytorch_lightning/trainer/trainer.py

Edits are minor. Maybe you could include this in the PR.

@Borda
Copy link
Member Author

Borda commented Feb 15, 2020

Sure, I have already applied the command as part of this PR but it creates change in the if statement which violate fake8 check...

Here is the correct command: autopep8 -v -r --in-place .

That's better, thx

@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

You should be able to ignore specific lines of code with # noqa (haven't tested).

@Borda
Copy link
Member Author

Borda commented Feb 15, 2020

You should be able to ignore specific lines of code with # noqa (haven't tested).

Sure, we are already using it in deprecated inits, but we shall not use this local fix for systematic issues lol

@hadim
Copy link
Contributor

hadim commented Feb 15, 2020

Of course! Only for things that autopep8 and/or flake8 don't understand properly.

@Borda Borda added the ready PRs ready to be merged label Feb 15, 2020
@Borda
Copy link
Member Author

Borda commented Feb 15, 2020

the problem was the if statement was not properly aligned on the next line so autopep8 fix it but the fix was not correct according to flake8...

@williamFalcon williamFalcon merged commit 9f93944 into Lightning-AI:master Feb 16, 2020
@Borda Borda deleted the autopep8 branch February 16, 2020 08:02
hanbyul-kim pushed a commit to hanbyul-kim/pytorch-lightning that referenced this pull request Feb 16, 2020
* add autopep8 to Contrib.

* simplify cmd

* update GH templates

* add pytest-flake8

* update GH template
@Borda Borda added this to the 0.7.0 milestone Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants