enforce 'yamllint' checks#2357
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
| search: | ||
| bounded_queue: [False, True] | ||
| check_relative_distance: [False, True] | ||
| bounded_queue: [false, true] |
There was a problem hiding this comment.
yamllint caught these.
YAML 1.1 treats True (capital T) as a boolean true.
YAML 1.2 only supports true / false and treats True as the string "True". See https://yaml.org/spec/1.2.2/#10212-boolean
This maybe hasn't bitten us yet because a lot of YAML parsers still respect the 1.1 spec (example: yaml/pyyaml#116), but it's a nice bit of future-proofing to just use the values supported by both versions.
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks |
There was a problem hiding this comment.
This diff looks huge because there was inconsistent indentation used throughout. Indentation matters for correctness in YAML. I didn't find any cases where the wrong indentation led to an actual issue, but still think it'd be good to standardize on one... so I chose 2 spaces, which lots of other RAPIDS projects use for this file.
In the future, if someone uses a different indentation here yamllint with catch it and complain, so it should help us stay consistent.
| - repo: https://github.com/adrienverge/yamllint | ||
| rev: v1.38.0 | ||
| hooks: | ||
| - id: yamllint | ||
| additional_dependencies: [pyyaml] | ||
| exclude: | | ||
| (?x)^( | ||
| conda/environments/.*| | ||
| cpp/[.]clang-format$| | ||
| cpp/[.]clang-tidy$ | ||
| ) |
There was a problem hiding this comment.
It's hard to spot in this big diff, so just calling out that here's the new yamllint config I'm proposing introducing.
Everything else in this file's diff is just whitespace changes.
Description
Contributes to rapidsai/build-planning#305
Proposes enforcing
yamllintchecks here. My primary motivation is to catch correctness issues independencies.yamlfiles, like duplicate entries silently resolving to the last one or indentation mistakes leading to filters being ignored.But this also has some side benefits for consistency, which makes it a bit easier to write automation.