Skip to content

Commit

Permalink
black and flake8 config
Browse files Browse the repository at this point in the history
  • Loading branch information
devanshshukla99 committed Apr 13, 2023
1 parent fb98a57 commit b937044
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Code Reviews are super-useful: another contributor can review the code, which me

- **Code Formatters:** We follow Astropy, enforcing this style guide using the black code formatter, see [The Black Code Style](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html) for details. Please run

`black -l 100 stingray`
`black stingray`

before each commit
- **Imports:**
Expand Down
1 change: 1 addition & 0 deletions docs/changes/715.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved contributing workflow by appending ``black`` codestyle configuration to ``pyproject.toml`` and ignoring PEP-8 non-compliant ``E203``, ``W503`` in ``flake8``.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ build-backend = 'setuptools.build_meta'
directory = "trivial"
name = "Internal Changes"
showcontent = true

[tool.black]
line-length = 100
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ exclude = extern,*parsetab.py,*lextab.py,test_*.py,__*.py
[flake8]
max-line-length = 100
exclude = extern,*parsetab.py,*lextab.py,test_*.py,__*.py
extend-ignore = E203, W503, W605
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ skip_install = true
changedir = .
description = check code style, e.g. with flake8
deps = flake8
commands = flake8 stingray --count --max-line-length=100 --ignore=W605
commands = flake8 stingray --count

[testenv:black]
skip_install = true
changedir = .
description = use black
deps =
black ~= 23.1.0
commands = black -l 100 --check stingray
commands = black --check stingray

0 comments on commit b937044

Please sign in to comment.