Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#589 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@i-am-paradox 已经在做这个了。

开始于 2026年10月13日。

  • #597 来自 @i-am-paradox —— 未关闭

评估

难度
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 退出,并打印级别存储在标签中的 controls 的分级明细。

由索引模型根据 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
平均合并
1 天 20 小时
30 天内合并 PR
39

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

darnitdevorg/darnit 的其他 Issue

查看 darnitdevorg/darnit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。