updated requested changes in PR #6636

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி 2022-04-05 10:21:07 +05:30
parent e2a42d3027
commit 57af08fde7
3 changed files with 32 additions and 4 deletions

View File

@ -5,11 +5,30 @@ repos:
rev: '4.0.1' rev: '4.0.1'
hooks: hooks:
- id: flake8 - id: flake8
args: stages: [push]
- max-line-length = 100,
- max-complexity = 12
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.942' rev: 'v0.942'
hooks: hooks:
- id: mypy - id: mypy
args: [--ignore-missing-imports] stages: [push]
- repo: https://github.com/pycqa/isort
rev: '5.10.1'
hooks:
- id: isort
name: isort (python)
stages: [push]
# https://github.com/pre-commit/pre-commit/issues/761#issuecomment-394167542
- repo: local
hooks:
- id: pytest
name: pytest
entry: venv/bin/pytest
language: script
pass_filenames: false
# alternatively you could `types: [python]` so it only runs when python files change
# though tests might be invalidated if you were to say change a data file
always_run: true
stages: [push]

View File

@ -20,6 +20,8 @@ Best start by reading the [documentation](https://www.freqtrade.io/) to get a fe
## Before sending the PR ## Before sending the PR
Do the following if you disabled pre-commit hook when commiting.
### 1. Run unit tests ### 1. Run unit tests
All unit tests must pass. If a unit test is broken, change your code to All unit tests must pass. If a unit test is broken, change your code to

View File

@ -51,6 +51,7 @@ function updateenv() {
echo "pip install in-progress. Please wait..." echo "pip install in-progress. Please wait..."
${PYTHON} -m pip install --upgrade pip ${PYTHON} -m pip install --upgrade pip
read -p "Do you want to install dependencies for dev [y/N]? " read -p "Do you want to install dependencies for dev [y/N]? "
dev=$REPLY
if [[ $REPLY =~ ^[Yy]$ ]] if [[ $REPLY =~ ^[Yy]$ ]]
then then
REQUIREMENTS=requirements-dev.txt REQUIREMENTS=requirements-dev.txt
@ -88,6 +89,12 @@ function updateenv() {
fi fi
echo "pip install completed" echo "pip install completed"
echo 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 # Install tab lib