这是我对 github 操作的设置:
---
name: Checks
on: [push]
jobs:
test-lint:
name: Test and Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: docker-compose run --rm app sh -c "python manage.py wait_for_db && python manage.py test"
- name: Lint
run: docker-compose run --rm app sh -c "flake8"
您面临的问题是文件
wait_for_db.py
中有一些额外的空格,特别是在5
行中,并且您还需要在此文件23
的末尾添加一个空行。另外,您还必须确保 test_commands.py
的末尾只有一行。
错误:
您可以在以下链接中获得每个
flake8
规则的清晰解释:https://www.flake8rules.com/