Skip to content

Commit

Permalink
test: Also check yaml format in .yml files
Browse files Browse the repository at this point in the history
  • Loading branch information
ffrank committed Feb 27, 2024
1 parent 301320d commit 468cceb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# You can add one username per supported platform and one custom link.
custom: "https://paypal.me/purpleidea"
github: purpleidea
Expand Down
5 changes: 3 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:
Expand Down Expand Up @@ -77,7 +78,7 @@ labels:
# oldname: Help Wanted

# Collaborators: give specific users access to this repository.
#collaborators:
# collaborators:
# - username: purpleidea
# # Note: Only valid on organization-owned repositories.
# # The permission to grant the collaborator. Can be one of:
Expand All @@ -91,7 +92,7 @@ labels:

# NOTE: The APIs needed for teams are not supported yet by GitHub Apps
# https://developer.github.com/v3/apps/available-endpoints/
#teams:
# teams:
# - name: core
# permission: admin
# - name: docs
Expand Down
34 changes: 18 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
language: go
os:
- linux
Expand All @@ -20,34 +21,35 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then travis_retry travis_retry sudo apt update; fi
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch --unshallow

install: 'make deps'
matrix:
fast_finish: false
allow_failures:
- go: 1.21.x
- go: tip
- os: osx
- go: 1.21.x
- go: tip
- os: osx
# include only one build for osx for a quicker build as the nr. of these runners are sparse
include:
- name: "basic tests"
go: 1.20.x
env: TEST_BLOCK=basic
- name: "shell tests"
go: 1.20.x
env: TEST_BLOCK=shell
- name: "race tests"
go: 1.20.x
env: TEST_BLOCK=race
- go: 1.21.x
- go: tip
- os: osx
- name: "basic tests"
go: 1.20.x
env: TEST_BLOCK=basic
- name: "shell tests"
go: 1.20.x
env: TEST_BLOCK=shell
- name: "race tests"
go: 1.20.x
env: TEST_BLOCK=race
- go: 1.21.x
- go: tip
- os: osx
script: 'TEST_BLOCK="$TEST_BLOCK" make test'

# the "secure" channel value is the result of running: ./misc/travis-encrypt.sh
# with a value of: irc.freenode.net#mgmtconfig to eliminate noise from forks...
notifications:
irc:
#channels:
# channels:
# - secure: htcuWAczm3C1zKC9vUfdRzhIXM1vtF+q0cLlQFXK1IQQlk693/pM30Mmf2L/9V2DVDeps+GyLdip0ARXD1DZEJV0lK+Ca1qbHdFP1r4Xv6l5+jaDb5Y88YU5LI8K758QShiZJojuQ1aO2j8xmmt9V0/5y5QwlpPeHbKYBOFPBX3HvlT9DhvwZNKGhBb4qJOEaPVOwq9IkN3DyQ456MHcJ3q3vF9Lb440uTuLsJNof2AbYZH8ZIHCSG2N8tBj2qhJOpWQboYtQJzE2pRaGkGBL4kYcHZSZMXX8sl4cBM1vx/IRUkvBxJUpLJz2gn/eRI+/gr59juZE2K0+FOLlx9dLnX626Y9xSViopBI6JsIoHJDqNC7aGaF2qaYulGYN65VNKVqmghjgt6JLmmiKeH10hYrJMMvt2rms8l4+5iwmCwXvhH/WU9edzk2p5wqERMnostJFEJib0zI3yzLoF0sdJs+veKtagzfayY2d2l7hlmt951IpqqVWldVgWUcQKVvi8gmRarbwFlK+5D7BEnkUDcLNly/cqf7BgEeX6YfF+FiR4pgfOhYvGCD+2q91NgWQXHBCxbyN0be1TVdkXD94f0Lkn94VyEJJ+PkPlG+rPgFwGcjqN4oEGkJeJmES2If05q2Ms1dJLwYQDL3+Py4lNMSdSWj24TzlFVhtwHepuw=
template:
- "%{repository} (%{commit}: %{author}): %{message}"
Expand Down
4 changes: 2 additions & 2 deletions test/test-yamlfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ if [ -z "$LINTER" ]; then
fi

find_files() {
git ls-files | grep '\.yaml$' \
git ls-files | grep '\.ya\?ml$' \
|| fail_test "Could not find yaml files via git ls-files"
}

bad_files=$(
find_files | xargs $LINTER | grep '\.yaml$'
find_files | xargs $LINTER | grep '\.ya\?ml$'
)

if [[ -n "${bad_files}" ]]; then
Expand Down

0 comments on commit 468cceb

Please sign in to comment.