diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..7c45005 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 88 +select = B,C,E,F,W +ignore = E203, W503 \ No newline at end of file diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 88b5381..d006da1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -11,14 +11,14 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache pip requirements - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-python3.8-pip-${{ hashfiles('setup.cfg') }} restore-keys: | ${{ runner.os }}-python3.8-pip- - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: "3.8" - name: Install dependencies @@ -31,20 +31,35 @@ jobs: black ./ isort --check ./ git diff --exit-code + flake8: + name: Lint with Flake8 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Install requirements + run: | + python -m pip install -U .[lint] + - name: Lint with Flake8 + run: | + python -m flake8 docs: name: Build docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Cache pip requirements - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-python3.7-pip-${{ hashfiles('setup.cfg') }} restore-keys: | ${{ runner.os }}-python3.7-pip- - name: Set up Python 3.7 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: "3.7" - name: Install dependencies @@ -68,14 +83,14 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache pip requirements - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ~/.cache/pip key: ${{ runner.os }}-python${{ matrix.python-version }}-pip-${{ hashfiles('setup.cfg') }} restore-keys: | ${{ runner.os }}-python${{ matrix.python-version }}-pip- - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/setup.cfg b/setup.cfg index 6dbb35d..ddc4499 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,8 @@ docs = sphinx>=3.1.2,<3.2.0 sphinxcontrib-trio==1.1.2 sphinx_rtd_theme>=0.5.0,<0.6.0 +lint = + flake8>=3.8.3,<4.0.0 style = black==19.10b0 isort==5.2.0