Skip to content

Commit

Permalink
black in setup and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Apr 17, 2023
1 parent 501a726 commit 5e139c5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.32.0
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: yapf
args: [ "-i", "-r" ]
types: [ "python" ]
additional_dependencies: [ "toml" ]
- id: black
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Formatting

Your Python code will be checked for errors and formatting when opening a PR.
We use the `flake8 <https://flake8.pycqa.org/en/latest/>`_ linter to check code quality,
and `yapf <https://github.com/google/yapf>`_ to enforce code formatting.
and `black <https://github.com/psf/black>`_ to enforce code formatting.
Make sure that running your code though these tools does not generate any output before
you push your changes.

Expand All @@ -82,7 +82,7 @@ From the top level directory, you can use
.. code-block:: sh
>$ flake8 .
>$ yapf --diff --recursive .
>$ black .
Jupyter notebooks style
-----------------------
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ channels:
- nodefaults

dependencies:
- black==23.3.0
- conda-build=3.23.3
- flake8=6.0.0
- gitpython=3.1.30
Expand All @@ -31,7 +32,6 @@ dependencies:
- sphinx=4.5.0
- sphinx-book-theme=0.3.3
- sphinx-copybutton=0.5.0
- yapf=0.32.0
- pip:
- nb-clean==2.4.0
- orsopy==1.0.1
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ exclude_dirs = ["docs/conf.py", "docs/make_docs.py", "tests", "install", "tools"
ignore-words-list = "elemt"
skip = "./.git,./install,./build,./.tox,*/*_cache,*/.virtual_documents,*/.ipynb_checkpoints,*.pdf,*.svg"

[tool.black]
skip-string-normalization = true

[tool.isort]
skip_gitignore = true
line_length = 88
multi_line_output = 2 # for compatibility with yapf
profile = "black"

[tool.mypy]
mypy_path = "src"
Expand Down
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ plopp = py.typed
# See https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
max-line-length = 88
extend-ignore = E203

[yapf]
based_on_style = pep8
column_limit = 88

0 comments on commit 5e139c5

Please sign in to comment.