From 95a35a4635815a21c7322f76f70adb31af637d06 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 23 Jul 2026 09:38:27 -0500 Subject: [PATCH 1/2] enforce 'yamllint' checks --- .github/CODEOWNERS | 1 + .github/workflows/pr.yaml | 4 +++ .pre-commit-config.yaml | 13 ++++++- .yamllint.yaml | 35 +++++++++++++++++++ codecov.yml | 2 +- conda/recipes/cuopt/recipe.yaml | 4 +-- conda/recipes/libcuopt/recipe.yaml | 12 +++---- cpp/src/grpc/codegen/field_registry.yaml | 3 ++ dependencies.yaml | 26 +++++++------- .../guide/cuopt-nimservice-full.yaml | 14 ++++---- 10 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 .yamllint.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3248c7ecfb..4edf6d3f91 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -19,6 +19,7 @@ container-builder/ @nvidia/cuopt-infra-codeowners /.github/ @nvidia/cuopt-ci-codeowners /ci/ @nvidia/cuopt-ci-codeowners /.pre-commit-config.yaml @nvidia/cuopt-ci-codeowners +/.yamllint.yaml @nvidia/cuopt-ci-codeowners #agent/infra code owners (overrides .github/ for specific paths) /AGENTS.md @nvidia/cuopt-infra-codeowners diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 962e724ee1..5a458692c2 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -97,6 +97,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.gitignore' - '!.pre-commit-config.yaml' + - '!.yamllint.yaml' - '!codecov.yml' - '!AGENTS.md' - '!CHANGELOG.md' @@ -156,6 +157,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.gitignore' - '!.pre-commit-config.yaml' + - '!.yamllint.yaml' - '!codecov.yml' - '!AGENTS.md' - '!CONTRIBUTING.md' @@ -226,6 +228,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.gitignore' - '!.pre-commit-config.yaml' + - '!.yamllint.yaml' - '!codecov.yml' - '!AGENTS.md' - '!CONTRIBUTING.md' @@ -293,6 +296,7 @@ jobs: - '!.github/workflows/trigger-breaking-change-alert.yaml' - '!.gitignore' - '!.pre-commit-config.yaml' + - '!.yamllint.yaml' - '!codecov.yml' - '!AGENTS.md' - '!CONTRIBUTING.md' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d084d6a64e..ba5636bab6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,17 @@ repos: hooks: - id: shellcheck args: ["--severity=warning"] + - repo: https://github.com/adrienverge/yamllint + rev: v1.38.0 + hooks: + - id: yamllint + additional_dependencies: [pyyaml] + exclude: | + (?x)^( + [.]clang-format$| + conda/environments/.*| + ^helmchart/cuopt-server/templates + ) - repo: https://github.com/rapidsai/pre-commit-hooks rev: v1.6.0 hooks: @@ -133,4 +144,4 @@ repos: default_language_version: - python: python3 + python: python3 diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000000..45195c9305 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,35 @@ +extends: default + +rules: + anchors: + forbid-undeclared-aliases: true + forbid-duplicated-anchors: true + forbid-unused-anchors: true + braces: + forbid: false + min-spaces-inside: 0 + # allow 1 space for jinja templating in conda recipes + max-spaces-inside: 1 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: enable + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: disable + comments-indentation: disable + document-end: disable + document-start: disable + key-duplicates: + forbid-duplicated-merge-keys: true + line-length: disable + truthy: + allowed-values: ['false', 'true'] + # having problematic value in keys is rare... and also + # GitHub Actions' choie of 'on:' triggers this check + # ref: https://github.com/adrienverge/yamllint/issues/430 + check-keys: false diff --git a/codecov.yml b/codecov.yml index b034ba32d8..b6d05ece44 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,7 +2,7 @@ comment: false coverage: status: - project: off + project: off # yamllint disable-line rule:truthy patch: default: target: auto diff --git a/conda/recipes/cuopt/recipe.yaml b/conda/recipes/cuopt/recipe.yaml index fa134c6e5f..bc1bac5f88 100644 --- a/conda/recipes/cuopt/recipe.yaml +++ b/conda/recipes/cuopt/recipe.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 schema_version: 1 @@ -26,7 +26,7 @@ build: prefix_detection: # See https://github.com/rapidsai/build-planning/issues/160 # Blanket ignore here as there are quite a few shared objects shipped in cuopt - ignore_binary_files: True + ignore_binary_files: true script: content: | ./build.sh cuopt diff --git a/conda/recipes/libcuopt/recipe.yaml b/conda/recipes/libcuopt/recipe.yaml index 77c957eade..56af03fde3 100644 --- a/conda/recipes/libcuopt/recipe.yaml +++ b/conda/recipes/libcuopt/recipe.yaml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 schema_version: 1 @@ -159,11 +159,11 @@ outputs: - libboost - libboost_iostreams tests: - - package_contents: - files: - - lib/libcuopt.so - - bin/cuopt_cli - - bin/cuopt_grpc_server + - package_contents: + files: + - lib/libcuopt.so + - bin/cuopt_cli + - bin/cuopt_grpc_server about: homepage: ${{ load_from_file("python/cuopt/pyproject.toml").project.urls.Homepage }} license: ${{ load_from_file("python/cuopt/pyproject.toml").project.license }} diff --git a/cpp/src/grpc/codegen/field_registry.yaml b/cpp/src/grpc/codegen/field_registry.yaml index 8ae0ff26b8..ba7fda3b5b 100644 --- a/cpp/src/grpc/codegen/field_registry.yaml +++ b/cpp/src/grpc/codegen/field_registry.yaml @@ -109,6 +109,9 @@ # Proto value names: proto_prefix + UPPER_SNAKE(CppName), or just CppName if # no prefix. # + +# yamllint disable rule:indentation + enums: pdlp_termination_status: domain: solution diff --git a/dependencies.yaml b/dependencies.yaml index 8681723994..7daac6f47d 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -73,14 +73,14 @@ files: docs: output: none includes: - - cuda - - cuda_version - - depends_on_libcuopt - - depends_on_cuopt - - depends_on_cuopt_server - - depends_on_cuopt_sh_client - - docs - - py_version + - cuda + - cuda_version + - depends_on_libcuopt + - depends_on_cuopt + - depends_on_cuopt_server + - depends_on_cuopt_sh_client + - docs + - py_version py_build_libcuopt: output: pyproject pyproject_dir: python/libcuopt @@ -239,8 +239,8 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - &cmake_ver cmake>=4.0 - - &ninja ninja + - cmake>=4.0 + - ninja - output_types: conda packages: - c-compiler @@ -473,7 +473,7 @@ dependencies: common: - output_types: [conda, requirements, pyproject] packages: - - &cuopt_sh_client_unsuffixed cuopt-sh-client==26.8.*,>=0.0.0a0 + - cuopt-sh-client==26.8.*,>=0.0.0a0 - output_types: requirements packages: # pip recognizes the index as a global option for the requirements.txt file @@ -805,8 +805,8 @@ dependencies: - sphinxcontrib-websupport - sphinx-design - pip: - - swagger-plugin-for-sphinx - - nvidia-sphinx-theme + - swagger-plugin-for-sphinx + - nvidia-sphinx-theme notebooks: common: diff --git a/docs/cuopt/source/cuopt-server/nim-operator/guide/cuopt-nimservice-full.yaml b/docs/cuopt/source/cuopt-server/nim-operator/guide/cuopt-nimservice-full.yaml index ea48f3095f..763b73b276 100644 --- a/docs/cuopt/source/cuopt-server/nim-operator/guide/cuopt-nimservice-full.yaml +++ b/docs/cuopt/source/cuopt-server/nim-operator/guide/cuopt-nimservice-full.yaml @@ -50,13 +50,13 @@ spec: - host: cuopt.example.com http: paths: - - backend: - service: - name: cuopt-service - port: - number: 8000 - path: / - pathType: Prefix + - backend: + service: + name: cuopt-service + port: + number: 8000 + path: / + pathType: Prefix metrics: enabled: true serviceMonitor: From 46c33bd0f2d70a67e01cb2cfd66a05319249314e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 23 Jul 2026 16:10:15 -0500 Subject: [PATCH 2/2] add copyright --- .yamllint.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.yamllint.yaml b/.yamllint.yaml index 45195c9305..ba2cbe1669 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 extends: default rules: