Skip to content

Commit

Permalink
Add black to ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Apr 29, 2020
1 parent 5161b7a commit 364c77a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
Expand All @@ -31,12 +31,17 @@ jobs:
run: |
pip install .
- name: Lint
- name: Flake8
run: |
pip install -U black && black --check . || true
pip install -U hacking
pip install hacking
flake8 .
- name: Black
run: |
pip install black
black --check .
if: matrix.python-version == '3.8'

- name: Test with pytest
run: |
pip install pytest
Expand Down
6 changes: 4 additions & 2 deletions gdown/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
CHUNK_SIZE = 512 * 1024 # 512KB


if hasattr(textwrap, 'indent'):
if hasattr(textwrap, "indent"):
indent_func = textwrap.indent
else:

def indent_func(text, prefix):
def prefixed_lines():
for line in text.splitlines(True):
yield (prefix + line if line.strip() else line)
return ''.join(prefixed_lines())

return "".join(prefixed_lines())


def get_url_from_gdrive_confirmation(contents):
Expand Down

0 comments on commit 364c77a

Please sign in to comment.