Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#524 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
54/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
22
Fork
27
Merge trung bình
2 ngày 28 phút
Pull request đã merge (30 ngày)
40

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của darnitdevorg/darnit

Tất cả issue của darnitdevorg/darnit

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.