-
Notifications
You must be signed in to change notification settings - Fork 56
Configure flake8 and yapf with pre-commit #215
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
Changes from all commits
4c286ed
bca779f
5fe7f9b
33c9791
4586475
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [flake8] | ||
| ignore = | ||
| # A continuation line is under-indented for a visual indentation. | ||
| E128 | ||
|
|
||
| max-line-length=80 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| exclude: '^$' | ||
| fail_fast: true | ||
| repos: | ||
| - repo: https://github.com/pre-commit/mirrors-yapf | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not seem to be v. actively used and maintained, what do you think about enabling without mirror?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am curious how did you decide this? I see
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for linking this, my observation was 👎 skipped over
☝️ what you understood, a fork of our own or code to enable a pre-commit hook. |
||
| sha: v0.20.0 | ||
| hooks: | ||
| - id: yapf | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| sha: v1.1.1 | ||
| hooks: | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| - id: flake8 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,48 +9,61 @@ We are trying to create a medium where people who want to start with contributin | |
| [Website](http://opensourcehelpcommunity.herokuapp.com/) [WIP] | ||
|
|
||
| ## Deployement details | ||
|
|
||
| After every commit | ||
|
|
||
| 1. The `predev` branch on GitHub is automatically deployed to [opensourcehelpcommunity-predev.herokuapp.com](http://opensourcehelpcommunity-predev.herokuapp.com/). | ||
| 2. The `develop` branch on github is automatically deployed to [opensourcehelpcommunity-dev.herokuapp.com](http://opensourcehelpcommunity-dev.herokuapp.com/). | ||
| 3. The `master` branch is automatically deployed [to opensourcehelpcommunity.herokuapp.com](http://opensourcehelpcommunity.herokuapp.com/) . | ||
| 1. The `develop` branch on github is automatically deployed to [opensourcehelpcommunity-dev.herokuapp.com](http://opensourcehelpcommunity-dev.herokuapp.com/). | ||
| 1. The `master` branch is automatically deployed [to opensourcehelpcommunity.herokuapp.com](http://opensourcehelpcommunity.herokuapp.com/) . | ||
|
|
||
| This is using [Django(1.11)](https://www.djangoproject.com/) and [Bootstrap](http://getbootstrap.com/) | ||
|
|
||
| ## How to Contribute | ||
| This is an Open Source project and we would be happy to see contributors who report bugs and file feature requests submitting pull requests as well. This project adheres to the Collaborative [code of conduct](https://github.com/OpenSourceHelpCommunity/OpenSourceHelpCommunity.github.io/blob/develop/CODE_OF_CONDUCT.md). By participating, you expect to maintain the code of conduct. Before creating `New issue` and `Pull request`, please refer to the [template](docs). | ||
|
|
||
| This is an Open Source project and we would be happy to see contributors who report bugs and file feature requests submitting pull requests as well. This project adheres to the Collaborative [code of conduct](https://github.com/OpenSourceHelpCommunity/OpenSourceHelpCommunity.github.io/blob/develop/CODE_OF_CONDUCT.md). By participating, you expect to maintain the code of conduct. Before creating `New issue` and `Pull request`, please refer to the [template](docs). | ||
|
|
||
| All the development is done on `predev` branch and once we're ready for testing the deployment in real environment with databases we merge the `predev` branch with the `develop` branch. When we're ready for new release we merge `develop` with `master` to deploy it on our main website. **Please submit your pull request based on `predev` branch.** | ||
|
|
||
| ## Installations | ||
|
|
||
| Run | ||
| ``` | ||
|
|
||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
| to install everything required to run this project on heroku as well as on your local. | ||
|
|
||
| to install everything required to run this project on heroku as well as on your local. | ||
|
|
||
| ## To run this in your local | ||
|
|
||
| 1. Clone this repository using | ||
| ``` | ||
| git clone git@github.com:OpenSourceHelpCommunity/OpenSourceHelpCommunity.github.io.git | ||
| ``` | ||
|
|
||
| 2. Go inside main Django app [Instructional video on installing Django](https://youtu.be/qgGIqRFvFFk) | ||
| ``` | ||
| cd oshc | ||
| ``` | ||
|
|
||
| 3. Collectstatic files using | ||
| ``` | ||
| python manage.py collectstatic | ||
| ``` | ||
|
|
||
| 4. Run the app | ||
| ``` | ||
| python manage.py runserver | ||
| ``` | ||
|
|
||
| ```bash | ||
| git clone git@github.com:OpenSourceHelpCommunity/OpenSourceHelpCommunity.github.io.git | ||
| ``` | ||
|
|
||
| 1. Go inside main Django app [Instructional video on installing Django](https://youtu.be/qgGIqRFvFFk) | ||
|
|
||
| ```bash | ||
| cd oshc | ||
| ``` | ||
|
|
||
| 1. Install [pre-commit](pre-commit.com) into your git hooks. [pre-commit](pre-commit.com) will now run on every commit. Every time you clone a project that is using [pre-commit](pre-commit.com) running [pre-commit](pre-commit.com) install should always be the first thing you do after installing requirements. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in markdown it takes relative path if not put w/ the protocol, need a correction here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, I missed protocol in URL somehow during copy-paste or maybe my editor removed them. It seems you fixed it after merging, thanks. |
||
|
|
||
| ```bash | ||
| pre-commit install | ||
| ``` | ||
|
|
||
| 1. Collectstatic files using | ||
|
|
||
| ```bash | ||
| python manage.py collectstatic | ||
| ``` | ||
|
|
||
| 1. Run the app | ||
| ```bash | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for this cleanup! 🎉 I was planning to do this from quite a while but didn't. |
||
| python manage.py runserver | ||
| ``` | ||
|
|
||
| To run the web app in Debug mode set the DEBUG environment variable. | ||
| In Linux, run the `export DEBUG=True` command in the terminal. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,4 @@ whitenoise==3.3.1 | |
| django-allauth==0.33.0 | ||
| django-crispy-forms==1.7.0 | ||
| flake8==3.4.1 | ||
| pre-commit==1.4.1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..and moving it to separate dotfile is perfect!