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

Apply and ensure Black formatting #1101

Merged
merged 7 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Delete them if they are not appropriate for this pull request.
- [ ] I have properly documented new or changed features in the documention or in the docstrings
- [ ] I have properly documented unusual changes to the code in the comments around it
- [ ] I have made note of any breaking/backwards incompatible changes
- [ ] I formatted my code using `black -t py36`
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Code Format Check

on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Black Code Formatter
uses: lgeiger/[email protected]
with:
args: "--check --target-version py36 $GITHUB_WORKSPACE"
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## Keeping/Improving code quality

- Respect PEP8 standards!
- Respect PEP8 conventions!
- Just the right amount of comments. Try to write auto-documented code (with very explicit variable names).
- If you introduce a new functionality or fix a subtle bug, document it in the docstring/code.
- Moviepy's team adopted [black](https://github.com/psf/black) to autoformat the code. This is enforced for any pull request.

> Tip: use `black -t py36 .` to autoformat your code, or set black as a plugin of your editor.


## Using Github

Expand All @@ -26,10 +30,11 @@
- To make a change
- Create a new local branch: `git checkout -b branchname`
- Make any changes in it
- Make sure that your code still conforms to the formatting standard: `black -t py36 .`
- Run the test suite over it to expose any problems: `python3 setup.py test`
- Push the local branch to your fork on github: `git push -u origin branchname`
- Go to github.com/yourname/moviepy and it will display 'Recently pushed branches' giving you the option to make a Pull Request to the main repo
- Fill in any details for your PR and submit
- The test suite will automatically be ran over your submission
- A moviepy collaborator will review your code, and help you to get it merge-ready
- You don't have to have finished your feature/bugfix before submitting a PR; just mention that it is a work-in-progress
- You don't have to have finished your feature/bugfix before submitting a PR; just mention that it is a work-in-progress
Loading