Skip to content

Commit 014eb95

Browse files
authored
Merge pull request #60 from SVilgelm/black
Using black formatting
2 parents 312a540 + b6b92d5 commit 014eb95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7858
-7720
lines changed

.github/workflows/test.yml

+27-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,31 @@ on:
99
schedule:
1010
- cron: "0 1 * * *"
1111
jobs:
12-
test:
12+
checks:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.8
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install ".[dev]"
25+
- name: Format with black
26+
run: |
27+
if ! RES=$(black --check $(git diff --name-only --diff-filter=AM master -- "*.py") 2>&1); then
28+
RES="${RES//'%'/'%25'}"
29+
RES="${RES//$'\n'/'%0A'}"
30+
RES="${RES//$'\r'/'%0D'}"
31+
echo "::error ::${RES}"
32+
exit 1
33+
fi
34+
echo ${RES}
35+
unit-tests:
36+
needs: checks
1337
runs-on: ubuntu-latest
1438
strategy:
1539
matrix:
@@ -24,7 +48,7 @@ jobs:
2448
- name: Install dependencies
2549
run: |
2650
python -m pip install --upgrade pip
27-
pip install ".[dev]"
51+
pip install ".[test]"
2852
- name: Test with inv
2953
run: inv cover qa
3054
- name: Coveralls
@@ -35,7 +59,7 @@ jobs:
3559
env:
3660
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
3761
bench:
38-
needs: test
62+
needs: unit-tests
3963
runs-on: ubuntu-latest
4064
if: github.event_name == 'pull_request'
4165
steps:

CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ There are some rules to follow:
4141

4242
- your contribution should be documented (if needed)
4343
- your contribution should be tested and the test suite should pass successfully
44-
- your code should be mostly PEP8 compatible with a 120 characters line length
44+
- your code should be properly formatted (use ``black .`` to format)
4545
- your contribution should support both Python 2 and 3 (use ``tox`` to test)
4646

4747
You need to install some dependencies to develop on flask-restx:

README.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ Flask RESTX
1818
:target: https://pypi.org/project/flask-restx
1919
:alt: Supported Python versions
2020
.. image:: https://badges.gitter.im/Join%20Chat.svg
21-
:alt: Join the chat at https://gitter.im/python-restx
22-
:target: https://gitter.im/python-restx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
21+
:target: https://gitter.im/python-restx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
22+
:alt: Join the chat at https://gitter.im/python-restx
23+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
24+
:target: https://github.com/psf/black
25+
:alt: Code style: black
2326

2427

2528
Flask-RESTX is a community driven fork of `Flask-RESTPlus <https://github.com/noirbizarre/flask-restplus>`_.

0 commit comments

Comments
 (0)