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

Transform Lint Warnings into Errors #3756

Merged
merged 8 commits into from
Apr 16, 2024
Merged
31 changes: 31 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@ rules:
truthy: disable
line-length:
max: 1500
level: error
trailing-spaces:
level: error
comments-indentation:
level: error
comments:
level: error
braces:
level: error
indentation:
level: error
brackets:
level: error
colons:
level: error
commas:
level: error
empty-lines:
level: error
float-values:
level: error
hyphens:
level: error
key-duplicates:
level: error
new-line-at-end-of-file:
level: error
new-lines:
level: error
octal-values:
level: error

ignore:
- /build/.gomod/
Expand Down
8 changes: 4 additions & 4 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,23 +331,23 @@ steps:
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/CMakeLists.txt )
- --path=sdks/cpp/.build # CPP SDK build
- --path=sdks/cpp/.build # CPP SDK build
id: cpp-sdk-build-save-cache
waitFor:
- build-sdks
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( sdks/cpp/CMakeLists.txt )
- --path=test/sdk/cpp/sdk # CPP conformance test build
- --path=test/sdk/cpp/sdk # CPP conformance test build
id: cpp-sdk-conformance-save-cache
waitFor:
- sdk-conformance
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )
- --path=test/sdk/rust/.cargo # Rust conformance test build
- --path=test/sdk/rust/.cargo # Rust conformance test build
- --path=test/sdk/rust/.cargo-targets
- --no-clobber
id: rust-build-save-cache
Expand All @@ -357,7 +357,7 @@ steps:
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_HTMLTEST_CACHE_KEY
- --path=site/tmp # htmltest URL checks
- --path=site/tmp # htmltest URL checks
id: htmltest-save-cache
waitFor:
- tests
Expand Down
62 changes: 31 additions & 31 deletions examples/gameserverallocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,34 @@ spec:
mode: deathmatch
annotations:
map: garden22
# [Stage: Alpha]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't look right to me. It's indenting it under .metadata.annotations (visually) but I don't think that's where the structure is. Can you disable yammlint for this block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have rolled back the modifications in this file and added it to the yamllint configuration to be ignored.

Copy link
Collaborator

@zmerlynn zmerlynn Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better for pointwise suppressions like this to use comments to suppress it: https://yamllint.readthedocs.io/en/stable/disable_with_comments.html

ETA: It keeps the "configuration" next to the object, so to speak.

Copy link
Contributor Author

@Kalaiselvi84 Kalaiselvi84 Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following options to disable yamllint are working fine, I chose the first one, please let me know what you think..

  # yamllint disable rule:comments-indentation rule:line-length
  # yamllint disable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# [FeatureFlag:CountsAndLists]
# `Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.
#
# Priority of sorting is in descending importance. I.e. The position 0 `priority` entry is checked first.
#
# For `Packed` strategy sorting, this priority list will be the tie-breaker within the least utilised infrastructure, to ensure optimal
# infrastructure usage while also allowing some custom prioritisation of `GameServers`.
#
# For `Distributed` strategy sorting, the entire selection of `GameServers` will be sorted by this priority list to provide the
# order that `GameServers` will be allocated by.
# Optional.
# priorities:
# - type: Counter # Whether a Counter or a List.
# key: rooms # The name of the Counter or List.
# order: Ascending # "Ascending" lists smaller available capacity first.
# [Stage:Alpha]
# [FeatureFlag:CountsAndLists]
# Counter actions to perform during allocation. Optional.
# counters:
# rooms:
# action: Increment # Either "Increment" or "Decrement" the Counter’s Count.
# amount: 1 # Amount is the amount to increment or decrement the Count. Must be a positive integer.
# capacity: 5 # Amount to update the maximum capacity of the Counter to this number. Min 0, Max int64.
# List actions to perform during allocation. Optional.
# lists:
# players:
# addValues: # appends values to a List’s Values array. Any duplicate values will be ignored
# - x7un
# - 8inz
# capacity: 40 # Updates the maximum capacity of the Counter to this number. Min 0, Max 1000.
# [Stage: Alpha]
# [FeatureFlag:CountsAndLists]
# `Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.
#
# Priority of sorting is in descending importance. I.e. The position 0 `priority` entry is checked first.
#
# For `Packed` strategy sorting, this priority list will be the tie-breaker within the least utilised infrastructure, to ensure optimal
# infrastructure usage while also allowing some custom prioritisation of `GameServers`.
#
# For `Distributed` strategy sorting, the entire selection of `GameServers` will be sorted by this priority list to provide the
# order that `GameServers` will be allocated by.
# Optional.
# priorities:
# - type: Counter # Whether a Counter or a List.
# key: rooms # The name of the Counter or List.
# order: Ascending # "Ascending" lists smaller available capacity first.
# [Stage:Alpha]
# [FeatureFlag:CountsAndLists]
# Counter actions to perform during allocation. Optional.
# counters:
# rooms:
# action: Increment # Either "Increment" or "Decrement" the Counter’s Count.
# amount: 1 # Amount is the amount to increment or decrement the Count. Must be a positive integer.
# capacity: 5 # Amount to update the maximum capacity of the Counter to this number. Min 0, Max int64.
# List actions to perform during allocation. Optional.
# lists:
# players:
# addValues: # appends values to a List’s Values array. Any duplicate values will be ignored
# - x7un
# - 8inz
# capacity: 40 # Updates the maximum capacity of the Counter to this number. Min 0, Max 1000.
Loading