Skip to content

Commit

Permalink
fix: run sample1 on pre-commit; run all tests on pre-push
Browse files Browse the repository at this point in the history
fix: add default_install_hook_types

fix: add explicit stages
  • Loading branch information
Udayraj123 committed Jan 24, 2023
1 parent b69aa85 commit 94d184f
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 56 deletions.
53 changes: 40 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
exclude: '__snapshots__/.*$'
exclude: "__snapshots__/.*$"
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: check-yaml
stages: [commit]
- id: end-of-file-fixer
exclude_types: ["csv", "json"]
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
stages: [commit]
- id: trailing-whitespace
stages: [commit]
- repo: https://github.com/pycqa/isort
rev: 5.5.4
hooks:
- id: isort
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
stages: [commit]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
- id: black
stages: [commit]
- repo: https://github.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
- id: flake8
args:
- "F401,F841" # unused imports, unused variables
- "--ignore=E501,W503,E203,E741" # Line too long, Line break occurred before a binary operator, Whitespace before ':'
- "F401,F841" # unused imports, unused variables
- "--ignore=E501,W503,E203,E741" # Line too long, Line break occurred before a binary operator, Whitespace before ':'
stages: [commit]
- repo: local
hooks:
- id: pytest-on-commit
name: test run
entry: pytest -k sample1
language: system
pass_filenames: false
always_run: true
fail_fast: true
stages: [commit]
- repo: local
hooks:
- id: pytest-on-push
name: pytest-on-push
entry: pytest
language: system
pass_filenames: false
always_run: true
fail_fast: true
stages: [push]
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pytest>=7.1.3
pytest-mock>=3.10.0
syrupy>=3.0.6
freezegun>=1.2.2
pre-commit
pre-commit>=2.20.0
Loading

0 comments on commit 94d184f

Please sign in to comment.