Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterpieceElbow committed Jan 18, 2022
0 parents commit 13cf154
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266
max-line-length = 79
max-complexity = 18
select = B,C,E,F,W,T4,B9
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
pull_request:
branches:
- "master"

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Set Up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install pytest and flake8
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run flake8
run: flake8 app/
- name: Run tests
run: pytest tests/

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.idea/
.vscode/
*.iml
.env
.DS_Store
venv/
.pytest_cache/
**__pycache__/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Python boilerplate for GitHub tasks

- Read [the guideline](https://github.com/mate-academy/py-task-guideline/blob/main/README.md) before start
- Implement the task described [here](app/main.py)
3 changes: 3 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO: add initial code
def hello_world():
return "Hello, world!"
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==6.2.5
flake8==4.0.1
Empty file added tests/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO: add tests
from app.main import hello_world


def test_hello_world():
assert hello_world() == "Hello, world!"

0 comments on commit 13cf154

Please sign in to comment.