Skip to content

Commit

Permalink
Add yamllint (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Feb 14, 2024
1 parent a2d622b commit ce4bddd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 25 deletions.
31 changes: 16 additions & 15 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
change:
- head-branch: ['^change/']
- head-branch: ["^change/"]

enhancement:
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']
- head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"]

bug:
- head-branch: ['^fix/', '^bug/']
- head-branch: ["^fix/", "^bug/"]

chore:
- head-branch: ['^chore/']
- head-branch: ["^chore/"]

tests:
- any:
- head-branch: ['^tests/', '^test/']
- changed-files:
- any-glob-to-any-file: 'tests/**/*'
- all:
- changed-files:
- all-globs-to-all-files: ['!tests/requirements.txt']
- any:
- head-branch: ["^tests/", "^test/"]
- changed-files:
- any-glob-to-any-file: "tests/**/*"
- all:
- changed-files:
- all-globs-to-all-files: ["!tests/requirements.txt"]

documentation:
- head-branch: ['^docs/', '^doc/']
- head-branch: ["^docs/", "^doc/"]
- changed-files:
- any-glob-to-any-file: '**/*.md'
- any-glob-to-any-file: "**/*.md"

dependencies:
- head-branch: ['^deps/', '^dep/', '^dependabot/', 'pre-commit-ci-update-config']
- head-branch:
["^deps/", "^dep/", "^dependabot/", "pre-commit-ci-update-config"]
- changed-files:
- any-glob-to-any-file: ['go.mod', 'go.sum']
- any-glob-to-any-file: ["go.mod", "go.sum"]
19 changes: 16 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
pull_request:
branches:
- main
paths-ignore:
- "examples/**"
- "**.md"

defaults:
run:
shell: bash

concurrency:
group: ${{ github.ref_name }}-lint
Expand Down Expand Up @@ -54,3 +55,15 @@ jobs:
config: .markdownlint-cli2.yaml
globs: "**/*.md"
fix: false

yaml-lint:
name: YAML lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML files
run: yamllint .
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: OpenSSF Scorecards
on:
branch_protection_rule:
branch_protection_rule: # yamllint disable-line rule:empty-values
schedule:
- cron: "36 15 * * 3" # run every Wednesday at 15:36 UTC
push:
Expand Down
12 changes: 6 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:

before:
hooks:
- make LICENSES
- make LICENSES

builds:
- id: nginx-asg-sync
Expand Down Expand Up @@ -97,7 +97,7 @@ signs:
- cmd: cosign
artifacts: checksum
output: true
certificate: '${artifact}.pem'
certificate: "${artifact}.pem"
args:
- sign-blob
- "--output-signature=${signature}"
Expand All @@ -108,14 +108,14 @@ signs:
announce:
slack:
enabled: true
channel: '#announcements'
message_template: 'NGINX Plus Integration with Cloud Autoscaling {{ .Tag }} is out! Check it out: {{ .ReleaseURL }}'
channel: "#announcements"
message_template: "NGINX Plus Integration with Cloud Autoscaling {{ .Tag }} is out! Check it out: {{ .ReleaseURL }}"

milestones:
- close: true

snapshot:
name_template: 'edge'
name_template: "edge"

snapcrafts:
- summary: NGINX Plus Integration with Cloud Autoscaling
Expand All @@ -125,7 +125,7 @@ snapcrafts:
grade: devel
confinement: strict
publish: true
license: 'BSD 2-Clause'
license: "BSD 2-Clause"
apps:
nginx-asg-sync:
command: nginx-asg-sync
Expand Down
22 changes: 22 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
yaml-files:
- "*.yaml"
- "*.yml"

ignore-from-file: .gitignore

extends: default

rules:
comments:
min-spaces-from-content: 1
comments-indentation: enable
document-start: disable
empty-values: enable
line-length:
max: 120
ignore: |
.goreleaser.yml
.github/
truthy:
check-keys: false

0 comments on commit ce4bddd

Please sign in to comment.