Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`darnit config migrate` drops comments in `.project/darnit.yaml`

Open
#524 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
54/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
cli, tooling

Research direction

First check whether features 040 and 042 have landed, since the issue says the behavior may differ on main until then. Read packages/darnit/src/darnit/config/operator/migrate.py and compare _write_yaml_file with the round-trip helper used by darnit.config.context_writes and update_project_config. Add the requested test; done means comments survive migration and invalid existing .project/ files are rejected with validation errors.

Written by the indexing model from the issue text.

Description

interface-cli module-core quality

Applies once features 040 and 042 land (branch 042-candidate-integrity, not yet merged); until then the behaviour described may differ on main.

migrate_baseline_toml (packages/darnit/src/darnit/config/operator/migrate.py) writes .project/darnit.yaml through _write_yaml_file, which re-dumps the whole document and keeps only the leading header comment. Inline comments, comments between sections, and key formatting in an existing darnit.yaml are lost. Since feature 042, darnit.config.context_writes and update_project_config use a ruamel round-trip that preserves them (framework-design.md 7.9, FR-020).

Proposed fix: write the migrated controls: claims through the same round-trip helper, and refuse (with the validation errors) when either .project/ file is present but invalid, as the other writers do. Add a test that a commented darnit.yaml keeps its comments after darnit config migrate.

Dominant language
Python
Stars
22
Forks
27
Avg merge
2d 28m
Merged PRs (30d)
40

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from darnitdevorg/darnit

All issues in darnitdevorg/darnit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.