Skip to content

Commit

Permalink
Add yamlfmt and enforce via pre-commit (#636)
Browse files Browse the repository at this point in the history
* Add yamlfmt

* Add missing | to (technically) invalid YAML

* Run all of our yamls through yamlfmt
  • Loading branch information
mikeage authored Mar 1, 2024
1 parent 2ff564b commit 9b4e8ad
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
github: icosa-foundation
open_collective: icosa
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: Builds

on: # yamllint disable-line rule:truthy
Expand Down Expand Up @@ -786,7 +786,7 @@ jobs:
name: Publish changelog from last major build to open-brush-docs
needs: [configuration, build]
runs-on: ubuntu-latest
if:
if: |
github.event_name == 'push' &&
github.repository == 'icosa-foundation/open-brush' &&
(github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v'))
Expand Down Expand Up @@ -1047,7 +1047,6 @@ jobs:
./ovr-platform-util upload-quest-build --app-id ${OCULUS_QUEST_APP_ID} --app-secret ${OCULUS_QUEST_APP_SECRET} --apk OpenBrush_Quest_$VERSION.apk --channel Beta:quest2+ --debug_symbols_dir ./arm64-v8a/ --debug-symbols-pattern '*.so' --notes "${CHANGELOG}"
fi
publish_oculus_quest1:
name: Publish Oculus Quest 1 Release
needs: [configuration, build]
Expand Down Expand Up @@ -1088,7 +1087,6 @@ jobs:
./ovr-platform-util upload-quest-build --app-id ${OCULUS_QUEST_APP_ID} --app-secret ${OCULUS_QUEST_APP_SECRET} --apk OpenBrush_Quest1_$VERSION.apk --channel Beta:quest1only --debug_symbols_dir ./arm64-v8a/ --debug-symbols-pattern '*.so' --notes "${CHANGELOG}"
fi
publish_oculus_rift:
name: Publish Oculus Rift Release
needs: [configuration, build]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete_branch_cache.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
# Taken from https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
name: cleanup caches by a branch
on: # yamllint disable-line rule:truthy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_certs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: Generate iOS Certs

on: # yamllint disable-line rule:truthy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/get_license.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Acquire activation file
on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_setup.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: iOS One-Time Setup

on: workflow_dispatch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yamllint disable rule:line-length
---
# yamllint disable rule:line-length
name: pre-commit

on: # yamllint disable-line rule:truthy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_unity_credentials.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: Test Unity Credentials
on:
workflow_dispatch:
Expand Down
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ repos:
args:
- --load-plugins=pylint.extensions.redefined_variable_type,pylint.extensions.bad_builtin
- --disable=import-error
- repo: https://github.com/google/yamlfmt
rev: v0.11.0
hooks:
- id: yamlfmt
args:
- -conf
- .yamlfmt
- repo: local
hooks:
# Use dotnet format already installed on your machine
- id: dotnet-format
name: dotnet-format
language: system
entry: dotnet format whitespace
types_or: ["c#", "vb"]
types_or: [c#, vb]
exclude: ^(Assets/ThirdParty)|(Packages/)|(Assets/Photon/)
args:
- --folder
Expand Down
6 changes: 6 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
formatter:
include_document_start: true
indent: 2
retain_line_breaks_single: true
pad_line_comments: 2

0 comments on commit 9b4e8ad

Please sign in to comment.