Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,5 @@ jobs:
- name: Black check
run: black --check .

- name: Flake8 lint
run: flake8 .

- name: Run tests
run: pytest -q
run: pytest -q tests
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# workflow-python-lint
Only allows code that passes common linters for Python (black, etc) to merge into main

In the repo settings, open Branches, add a rule for main, and enable Require a pull request before merging.
Turn on Require status checks to pass and select Python CI or the ci job as a required check.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
return "Hello World"
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions tests/test_hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from app import hello


def test_hello_returns_expected_message():
assert hello() == "Hello World"