forked from pasqal-io/Pulser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CI checks with git hooks and pre-commit (pasqal-io#331)
* add pre-commit hooks * update contributing guidelines with pre-commit usage * fix a typo * Remove superflous args from isort hooks Running isort hook with --show-config arg and the verbose: true flag shows that the pyproject.toml configuration is read and used by the hook: ```terminal ... { "profile": "black", "line_length": 79, "source": "/Users/manta/Desktop/Pulser/pyproject.toml" } ... ```
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
mypy --config-file .mypy.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black-jupyter | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
|
||
# Calling mypy from a bash script, as I cannot figure out how to pass the | ||
# .mypy.ini config file when using the hook at | ||
# https://github.com/pre-commit/mirrors-mypy | ||
- repo: local | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
entry: ./.mypy_script | ||
language: script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ mypy == 0.921 | |
pytest | ||
pytest-cov | ||
|
||
# CI | ||
pre-commit | ||
|
||
# tutorials | ||
notebook | ||
python-igraph | ||
|