mirror of
https://github.com/CMiksche/gitea-auto-update
synced 2025-12-10 16:07:23 +01:00
feat: add pre-commit hooks
Add pre-commit hooks for running pylint and gitlint.
This commit is contained in:
16
.pre-commit-config.yaml
Normal file
16
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.5.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
||||||
|
- repo: https://github.com/PyCQA/pylint
|
||||||
|
rev: pylint-2.5.0
|
||||||
|
hooks:
|
||||||
|
- id: pylint
|
||||||
|
- repo: https://github.com/jorisroovers/gitlint
|
||||||
|
rev: v0.13.1
|
||||||
|
hooks:
|
||||||
|
- id: gitlint
|
||||||
1
Pipfile
1
Pipfile
@@ -12,6 +12,7 @@ fire = "*"
|
|||||||
configparser = "*"
|
configparser = "*"
|
||||||
gitlint = "*"
|
gitlint = "*"
|
||||||
pylint = "*"
|
pylint = "*"
|
||||||
|
pre-commit = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.7"
|
python_version = "3.7"
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -11,15 +11,15 @@ Script for a automatic update of gitea. Should be run locally on the gitea serve
|
|||||||
* Get latest Release via GitHub API
|
* Get latest Release via GitHub API
|
||||||
* Check if there is a newer Version
|
* Check if there is a newer Version
|
||||||
* If there is a newer Version:
|
* If there is a newer Version:
|
||||||
* If binary file was selected:
|
* If binary file was selected:
|
||||||
* Download new version
|
* Download new version
|
||||||
* Check sha256
|
* Check sha256
|
||||||
* Overwrite old version
|
* Overwrite old version
|
||||||
* If build from source is active:
|
* If build from source is active:
|
||||||
* Checkout new release branch
|
* Checkout new release branch
|
||||||
* Build binary
|
* Build binary
|
||||||
* Overwrite old binary
|
* Overwrite old binary
|
||||||
|
|
||||||
|
|
||||||
## General Information
|
## General Information
|
||||||
License: GNU General Public License
|
License: GNU General Public License
|
||||||
@@ -67,10 +67,16 @@ The following instructions help you for developing.
|
|||||||
* Clone this git repo
|
* Clone this git repo
|
||||||
* Install pipenv: `pip install pipenv`
|
* Install pipenv: `pip install pipenv`
|
||||||
* Install all dependencies: `pipenv install`
|
* Install all dependencies: `pipenv install`
|
||||||
|
* Install git pre-commit hooks (for pylint and gitlint) with `pre-commit install`
|
||||||
* You can run the tests with `python -m unittest`
|
* You can run the tests with `python -m unittest`
|
||||||
|
* After pushing, you should check the build status which currently checks the tests, pylint and the commit message format.
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
|
||||||
|
The following steps are automatically executed via pre-commit hooks.
|
||||||
|
|
||||||
* You can run pylint with `pylint gitea_auto_update`
|
* You can run pylint with `pylint gitea_auto_update`
|
||||||
* After changes and commit, you can check if your commit message follows the contribution guidelines with `gitlint`. If there is a problem, gitlint will show you a error message.
|
* After changes and commit, you can check if your commit message follows the contribution guidelines with `gitlint`. If there is a problem, gitlint will show you a error message.
|
||||||
* After pushing, you should check the build status which currently checks the tests, pylint and the commit message format.
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user