Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable yamllint check #136

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: v1.33.0
envoy_version: envoyproxy/envoy:v1.33.0
- name: latest
envoy_version: envoyproxy/envoy-dev:latest
- name: v1.33.0
envoy_version: envoyproxy/envoy:v1.33.0
- name: latest
envoy_version: envoyproxy/envoy-dev:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -156,10 +156,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: v1.2.5
envoy_gateway_version: v1.2.5
- name: latest
envoy_gateway_version: v0.0.0-latest
- name: v1.2.5
envoy_gateway_version: v1.2.5
- name: latest
envoy_gateway_version: v0.0.0-latest
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker_builds_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
- uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Login into GitHub Container Registry
uses: docker/login-action@v3
Expand Down
53 changes: 53 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---

ignore: |
manifests/charts/ai-gateway-helm

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 1
min-spaces-after: 1
max-spaces-after: 1
comments:
level: error
require-starting-space: true
min-spaces-from-content: 2
comments-indentation:
level: warning
document-end: disable
document-start: disable
empty-lines:
max: 2
max-start: 0
max-end: 1
empty-values:
forbid-in-block-mappings: false
forbid-in-flow-mappings: true
hyphens:
max-spaces-after: 1
indentation:
spaces: 2
indent-sequences: consistent # be consistent: don't mix indentation styles in one file.
check-multi-line-strings: false
key-duplicates: enable
key-ordering: disable
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
check-keys: false # GitHub Actions uses "on:" as a key
level: warning
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ codespell: $(CODESPELL)
@echo "spell => ./..."
@$(CODESPELL) --skip $(CODESPELL_SKIP) --ignore-words $(CODESPELL_IGNORE_WORDS)

.PHONY: yamllint
yamllint: $(YAMLLINT)
@echo "yamllint => ./..."
@$(YAMLLINT) --config-file=.yamllint $$(git ls-files :*.yml :*.yaml | xargs -L1 dirname | sort -u)

# This runs the formatter on the codebase as well as goimports via gci.
.PHONY: format
format: gci gofumpt
Expand All @@ -79,7 +84,7 @@ apigen: controller-gen

# This runs all necessary steps to prepare for a commit.
.PHONY: precommit
precommit: tidy codespell apigen format lint editorconfig helm-lint
precommit: tidy codespell apigen format lint editorconfig yamllint helm-lint

# This runs precommit and checks for any differences in the codebase, failing if there are any.
.PHONY: check
Expand Down
3 changes: 3 additions & 0 deletions Makefile.tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GO_FUMPT = $(LOCALBIN)/gofumpt
GCI = $(LOCALBIN)/gci
EDITORCONFIG_CHECKER = $(LOCALBIN)/editorconfig-checker
CODESPELL = $(LOCALBIN)/.venv/[email protected]/bin/codespell
YAMLLINT = $(LOCALBIN)/.venv/[email protected]/bin/yamllint
KIND ?= $(LOCALBIN)/kind

## Tool versions.
Expand Down Expand Up @@ -63,6 +64,8 @@ $(KIND): $(LOCALBIN)

$(CODESPELL): .bin/.venv/[email protected]

$(YAMLLINT): .bin/.venv/[email protected]

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
# $2 - package url which can be installed
Expand Down
8 changes: 4 additions & 4 deletions tests/cel-validation/testdata/aigatewayroutes/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ spec:
group: gateway.networking.k8s.io
rules:
- matches:
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
backendRefs:
- name: kserve
weight: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ spec:
name: OpenAI
rules:
- matches:
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
backendRefs:
- name: kserve
weight: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
group: gateway.networking.k8s.io
rules:
- matches:
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
backendRefs:
- name: kserve
weight: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
group: gateway.networking.k8s.io
rules:
- matches:
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
- headers:
- type: Exact
name: x-envoy-ai-gateway-model
value: llama3-70b
backendRefs:
- name: kserve
weight: 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ spec:
group: gateway.networking.k8s.io
rules:
- matches:
- headers:
- type: RegularExpression
name: x-envoy-ai-gateway-model
value: llama3-70b
- headers:
- type: RegularExpression
name: x-envoy-ai-gateway-model
value: llama3-70b
backendRefs:
- name: kserve
weight: 20
Expand Down
Loading