Skip to content

Commit fb0fe1e

Browse files
committed
Add lint task
1 parent 401d51d commit fb0fe1e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,22 @@ This repository contains a simple go app. You do not need to know go, nor use an
150150

151151
## Parallel jobs
152152

153+
Jobs in the same workflow file can be run in parallel if they're not dependent on each other.
154+
155+
1. We also want to lint the app code. In order to get faster feedback, we can lint create a separate job in our `test.yml` workflow file. Create a new job in `test.yml` for linting, which contains the following step:
156+
157+
```yml
158+
- name: Verify formatting
159+
run: |
160+
no_unformatted_files="$(gofmt -l $(git ls-files '*.go') | wc -l)"
161+
exit "$no_unformatted_files"
162+
```
163+
164+
You'll have to checkout the code repository and setup go, similarly to before.
165+
166+
2. Push the code and verify that the workflow runs two jobs successfully.
167+
153168
TODO:
154-
* Build, test & lint for each push to PR
155169
* Require build, tests & linting to succeed to merge PR
156170

157171
## Introduction to triggers

0 commit comments

Comments
 (0)