Skip to content

Commit

Permalink
feat: switch to black from yapf
Browse files Browse the repository at this point in the history
PySTAC uses black and we do our best to follow PySTAC.
  • Loading branch information
gadomski committed Apr 6, 2022
1 parent 0605c8d commit 7e797b0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 30 deletions.
5 changes: 1 addition & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ max-line-length = 100
# W503, W504: flake8 reports this as incorrect, and scripts/format_code
# changes code to it, so let format_code win.

# E126: Continuation line over-indented for hanging indent
# Conflicts with yapf formatting

ignore = E127,W503,W504,E126
ignore = E127,W503,W504
40 changes: 20 additions & 20 deletions .readthedocs.environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ dependencies:
- pip
- rasterio~=1.2
- pip:
- codespell
- coverage
- flake8
- ipython
- jupyter
- lxml-stubs
- mypy
- nbsphinx
- pylint
- sphinx
- sphinx-autobuild
- sphinx-click
- sphinxcontrib-fulltoc
- sphinxcontrib-napoleon
- types-certifi
- types-orjson
- types-python-dateutil
- types-requests
- yapf
- .
- black
- codespell
- coverage
- flake8
- ipython
- jupyter
- lxml-stubs
- mypy
- nbsphinx
- pylint
- sphinx
- sphinx-autobuild
- sphinx-click
- sphinxcontrib-fulltoc
- sphinxcontrib-napoleon
- types-certifi
- types-orjson
- types-python-dateutil
- types-requests
- .
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
black
codespell
flake8
importlib-metadata
Expand All @@ -15,10 +16,7 @@ sphinx-autobuild
sphinx-click
sphinxcontrib-fulltoc
sphinxcontrib-napoleon
# an explicit toml installation is required until https://github.com/google/yapf/commit/fb0fbb47723612608a7c64cb3835562160ea834c is released
toml
types-certifi
types-orjson
types-python-dateutil
types-requests
yapf
4 changes: 2 additions & 2 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi
function usage() {
echo -n \
"Usage: $(basename "$0")
Format code with yapf
Format code with black
"
}

Expand All @@ -20,6 +20,6 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
usage
else
# Code formatting
yapf -ipr ${DIRS_TO_CHECK[@]}
black ${DIRS_TO_CHECK[@]}
fi
fi
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
usage
else
# Code formatting
yapf -dpr ${DIRS_TO_CHECK[@]}
scripts/format
# Lint
flake8 ${DIRS_TO_CHECK[@]}
# Type checking
Expand Down

0 comments on commit 7e797b0

Please sign in to comment.