commit
cbdaaf705c
21
.pre-commit-config.yaml
Normal file
21
.pre-commit-config.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: '4.0.1'
|
||||
hooks:
|
||||
- id: flake8
|
||||
# stages: [push]
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: 'v0.942'
|
||||
hooks:
|
||||
- id: mypy
|
||||
# stages: [push]
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: '5.10.1'
|
||||
hooks:
|
||||
- id: isort
|
||||
name: isort (python)
|
||||
# stages: [push]
|
@ -26,6 +26,9 @@ Alternatively (e.g. if your system is not supported by the setup.sh script), fol
|
||||
|
||||
This will install all required tools for development, including `pytest`, `flake8`, `mypy`, and `coveralls`.
|
||||
|
||||
Then install the git hook scripts by running `pre-commit install`, so your changes will be verified locally before committing.
|
||||
This avoids a lot of waiting for CI already, as some basic formatting checks are done locally on your machine.
|
||||
|
||||
Before opening a pull request, please familiarize yourself with our [Contributing Guidelines](https://github.com/freqtrade/freqtrade/blob/develop/CONTRIBUTING.md).
|
||||
|
||||
### Devcontainer setup
|
||||
|
@ -7,6 +7,7 @@ coveralls==3.3.1
|
||||
flake8==4.0.1
|
||||
flake8-tidy-imports==4.6.0
|
||||
mypy==0.942
|
||||
pre-commit==2.18.1
|
||||
pytest==7.1.1
|
||||
pytest-asyncio==0.18.3
|
||||
pytest-cov==3.0.0
|
||||
|
7
setup.sh
7
setup.sh
@ -51,6 +51,7 @@ function updateenv() {
|
||||
echo "pip install in-progress. Please wait..."
|
||||
${PYTHON} -m pip install --upgrade pip
|
||||
read -p "Do you want to install dependencies for dev [y/N]? "
|
||||
dev=$REPLY
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
REQUIREMENTS=requirements-dev.txt
|
||||
@ -88,6 +89,12 @@ function updateenv() {
|
||||
fi
|
||||
echo "pip install completed"
|
||||
echo
|
||||
if [[ $dev =~ ^[Yy]$ ]] then
|
||||
${PYTHON} -m pre-commit install
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed installing pre-commit"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Install tab lib
|
||||
|
Loading…
Reference in New Issue
Block a user