Skip to content

Commit

Permalink
Merge pull request #5 from bbkane/git-xargs/format-yaml
Browse files Browse the repository at this point in the history
Format yaml and add lint
  • Loading branch information
bbkane authored Nov 15, 2023
2 parents 557c5e8 + dfb3e7c commit 5ec9890
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
name: CI

on:
push:
branches:
- master
pull_request:
workflow_call:

permissions:
contents: read

jobs:
setup:
name: CI
Expand All @@ -18,18 +6,28 @@ jobs:
# https://github.com/marketplace/actions/checkout`
- name: Checkout Repo
uses: actions/checkout@v3

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go 1.x >= 1.18
uses: actions/setup-go@v3
with:
go-version-file: go.mod
# requires go.sum file (i.e., external libraries)
cache: true

go-version-file: go.mod
# https://github.com/marketplace/actions/run-golangci-lint#how-to-use
- name: golangci-lint
uses: golangci/golangci-lint-action@v3

- name: go test
run: go test -v ./...
- name: Install yamllint
run: pip install yamllint
- name: Lint YAML files
run: yamllint .
name: CI
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- master
workflow_call:
permissions:
contents: read
11 changes: 11 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends: default
rules:
comments:
ignore-shebangs: true
min-spaces-from-content: 1
require-starting-space: true
document-start: disable
key-duplicates: disable
key-ordering: enable
line-length: disable
trailing-spaces: disable
8 changes: 5 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

pre-commit:
parallel: true
commands:
golangci-lint:
run: golangci-lint run
go-test:
run: go test ./...
golangci-lint:
run: golangci-lint run
yamllint:
run: yamllint .
parallel: true

0 comments on commit 5ec9890

Please sign in to comment.