Skip to content

Commit b3272d7

Browse files
committedSep 22, 2022
Initial commit
0 parents  commit b3272d7

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed
 

‎.github/workflows/test.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
python-version: [3.6, 3.7, 3.8]
16+
os: [ubuntu-latest]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Run the test
26+
run: |
27+
python test.py

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__/
2+
*.pyc

‎README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Forking workflow exercise with taco recipes
2+
3+
Exercise description: https://coderefinery.github.io/git-collaborative/distributed/

‎cauliflower_tacos.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
# Cauliflower tacos
4+
5+
This recipe is taken as an example from https://github.com/sinker/tacofancy/blob/master/full_tacos/cauliflower_tacos.md.
6+
7+
We are avid meat eaters, but these vegetarian tacos are one of our go-tos in
8+
Peru. If you can make the pickles with Peruvian aji amarillo, please do.
9+
10+
- Roast cauliflower
11+
- Pickled chilis and vegetables
12+
- Caramelized red onions
13+
- Guacamole
14+
- Yogurt
15+
- Tortilla of choice, warmed in a dry pan

‎test.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
This will loop through all files *.md and check that they contain the string
3+
'taco' (case-insensitive).
4+
"""
5+
6+
from __future__ import print_function
7+
import os
8+
import sys
9+
10+
for filename in os.listdir("."):
11+
if filename.endswith(".md"):
12+
with open(filename, 'r') as f:
13+
recipe = f.read().lower()
14+
if not 'taco' in recipe:
15+
print("file {0} contains no string 'taco'".format(filename), file=sys.stderr)
16+
sys.exit(1)
17+
18+
print("all *.md files contain the string 'taco'")

0 commit comments

Comments
 (0)
Please sign in to comment.