Skip to content

Commit 3ea2ae0

Browse files
authored
enforce 'yamllint' checks (#209)
Contributes to rapidsai/build-planning#305 Proposes enforcing `yamllint` checks here. My primary motivation is to catch correctness issues in `dependencies.yaml` files, 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. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) URL: #209
1 parent a44f536 commit 3ea2ae0

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ docs/ @rapidsai/cugraph-doc-codeowners
1010

1111
# CI code owners
1212
/.github/ @rapidsai/ci-codeowners
13+
/.yamllint.yaml @rapidsai/ci-codeowners
1314
/ci/ @rapidsai/ci-codeowners
1415

1516
# packaging code owners

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ repos:
1616
hooks:
1717
- id: shellcheck
1818
args: ["--severity=warning"]
19+
- repo: https://github.com/adrienverge/yamllint
20+
rev: v1.38.0
21+
hooks:
22+
- id: yamllint
23+
additional_dependencies: [pyyaml]
24+
exclude: |
25+
(?x)^(
26+
conda/environments/.*
27+
)
1928
- repo: https://github.com/zizmorcore/zizmor-pre-commit
2029
rev: v1.24.1
2130
hooks:

.yamllint.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
extends: default
4+
5+
rules:
6+
anchors:
7+
forbid-undeclared-aliases: true
8+
forbid-duplicated-anchors: true
9+
forbid-unused-anchors: true
10+
braces:
11+
forbid: false
12+
min-spaces-inside: 0
13+
# allow 1 space for jinja templating in conda recipes
14+
max-spaces-inside: 1
15+
min-spaces-inside-empty: -1
16+
max-spaces-inside-empty: -1
17+
brackets: enable
18+
colons:
19+
max-spaces-before: 0
20+
max-spaces-after: 1
21+
commas:
22+
max-spaces-before: 0
23+
min-spaces-after: 1
24+
max-spaces-after: 1
25+
comments: disable
26+
comments-indentation: disable
27+
document-end: disable
28+
document-start: disable
29+
key-duplicates:
30+
forbid-duplicated-merge-keys: true
31+
line-length: disable
32+
truthy:
33+
allowed-values: ['false', 'true']
34+
# having problematic value in keys is rare... and also
35+
# GitHub Actions' choie of 'on:' triggers this check
36+
# ref: https://github.com/adrienverge/yamllint/issues/430
37+
check-keys: false

0 commit comments

Comments
 (0)