Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`darnit validate` crashes on openssf-baseline.toml summarising levels

オープン 初心者向け
#589 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

packages/darnit/src/darnit/cli.py、特に cmd_validate と416行目付近のレベルごとのグループ化を読み、darnit audit がタグからレベルを読み取る方法と比較してください。Issueの手順に従い、同梱の openssf-baseline.toml を使って再現してください。完了条件は、darnit validate が終了コード0で終了し、レベルがタグに格納されているコントロールについてレベルごとの内訳を出力することです。

索引モデルが issue の本文から書いたものです。

説明

needs triage

Description

darnit validate on the bundled openssf-baseline.toml reports the framework as valid, then raises a TypeError and exits non-zero. The level breakdown in cmd_validate (packages/darnit/src/darnit/cli.py) groups controls by ctrl.level. The baseline TOML now keeps the level in tags, so ctrl.level is None for those controls, and sorted() fails when the keys mix int and None. darnit audit reads the level from tags and reports it correctly.

Steps to Reproduce

  1. pip install "darnit-mcp==0.1.1" "darnit-core==0.1.1" "darnit-baseline==0.1.1"
  2. darnit validate "$(python -c 'import importlib.resources as r; print(r.files("darnit_baseline") / "openssf-baseline.toml")')"

Expected Behavior

Exit 0 with the per-level breakdown.

Actual Behavior

INFO: Framework 'openssf-baseline' is valid
INFO:   Controls: 66
INFO:   Adapters: 0
Traceback (most recent call last):
  File "/opt/darnit/lib/python3.13/site-packages/darnit/cli.py", line 416, in cmd_validate
    logger.info(f"  By level: {', '.join(f'L{k}={v}' for k, v in sorted(by_level.items()))}")
TypeError: '<' not supported between instances of 'int' and 'NoneType'

Environment

  • darnit version: 0.1.1
  • Python version: 3.13
  • OS: Debian trixie (Docker)

Additional Context

We hit this running darnit in Alpha-Omega's scrutineer, which bundles it in its runner image for an OpenSSF Baseline compliance scan, with darnit validate as a build-time smoke test. The same code is still on main at 24a4fed. Reading the level as ctrl.level or ctrl.tags.get("level") there would match what the audit path does.

主要言語
Python
スター
22
フォーク
27
平均マージ
2日 28分
マージ済み PR(30日)
40

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

darnitdevorg/darnit のほかの issue

darnitdevorg/darnit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。