Merge pull request #258 from fronzbot/add-commit-hooks
Add commit hooks
This commit is contained in:
@@ -12,3 +12,4 @@ dist/*
|
||||
build/*
|
||||
docs/_build
|
||||
*.log
|
||||
venv
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 19.10b0
|
||||
hooks:
|
||||
- id: black
|
||||
args:
|
||||
- --safe
|
||||
- --quiet
|
||||
files: ^((blinkpy|tests)/.+)?[^/]+\.py$
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
rev: 3.8.1
|
||||
hooks:
|
||||
- id: flake8
|
||||
additional_dependencies:
|
||||
- flake8-docstrings==1.5.0
|
||||
- pydocstyle==5.0.2
|
||||
files: ^(homeassistant|tests)/.+\.py$
|
||||
+14
-5
@@ -15,17 +15,26 @@ You can do this right in github: just click the 'fork' button at the top right.
|
||||
$ git remote add upstream https://github.com/fronzbot/blinkpy.git
|
||||
```
|
||||
|
||||
2. Create a Local Branch
|
||||
2. Create virtualenv and install dependencies
|
||||
```shell
|
||||
$ python -m venv venv
|
||||
$ source venv/bin/activate
|
||||
$ pip install -r requirements.txt
|
||||
$ pip install -r requirements_test.txt
|
||||
$ pre-commit install
|
||||
```
|
||||
|
||||
3. Create a Local Branch
|
||||
|
||||
First, you will want to create a new branch to hold your changes:
|
||||
``git checkout -b <your-branch-name>``
|
||||
|
||||
|
||||
3. Make changes
|
||||
4. Make changes
|
||||
|
||||
Now you can make changes to your code. It is worthwhile to test your code as you progress (see the **Testing** section)
|
||||
|
||||
4. Commit Your Changes
|
||||
5. Commit Your Changes
|
||||
|
||||
To commit changes to your branch, simply add the files you want and the commit them to the branch. After that, you can push to your fork on GitHub:
|
||||
```shell
|
||||
@@ -34,7 +43,7 @@ You can do this right in github: just click the 'fork' button at the top right.
|
||||
$ git push origin HEAD
|
||||
```
|
||||
|
||||
5. Submit your pull request on GitHub
|
||||
6. Submit your pull request on GitHub
|
||||
|
||||
- On GitHub, navigate to the [blinkpy](https://github.com/fronzbot/blinkpy) repository.
|
||||
- In the "Branch" menu, choose the branch that contains your commits (from your fork).
|
||||
@@ -44,7 +53,7 @@ You can do this right in github: just click the 'fork' button at the top right.
|
||||
- Click Create pull request.
|
||||
- More detailed instructions can be found here: [Creating a Pull Request](https://help.github.com/articles/creating-a-pull-request/)
|
||||
|
||||
6. Prior to merge approval
|
||||
7. Prior to merge approval
|
||||
|
||||
Finally, the `blinkpy` repository uses continuous integration tools to run tests prior to merging. If there are any problems, you will see a red 'X' next to your pull request. To see what's wrong, you can find your pull request [here](https://travis- ci.org/fronzbot/blinkpy/pull_requests) and click on the failing test to see the logs. Those logs will indicate, as best as they can, what is causing that test to fail.
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ black==19.10b0
|
||||
coverage==5.1
|
||||
flake8==3.8.1
|
||||
flake8-docstrings==1.5.0
|
||||
pre-commit==2.4.0
|
||||
pylint==2.5.2
|
||||
pydocstyle==5.0.2
|
||||
pytest==5.4.1
|
||||
@@ -9,4 +10,4 @@ pytest-cov==2.8.1
|
||||
pytest-sugar==0.9.3
|
||||
pytest-timeout==1.3.4
|
||||
restructuredtext-lint==1.3.0
|
||||
pygments==2.6.1
|
||||
pygments==2.6.1
|
||||
|
||||
Reference in New Issue
Block a user