[FEATURE]: Read configuration from `pyproject.toml`

Đang mở
#231 2 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
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust

Hướng nghiên cứu

Start by tracing where codebook searches for codebook.toml and .codebook.toml, then read the configuration parsing tests and follow the existing TOML loading path. Add pyproject.toml fallback handling for [tool.codebook], preserving the documented precedence, and verify that its settings match equivalent root configuration.

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

Mô tả

enhancement
Feature Description

It would be nice if codebook could parse the configuration from a pyproject.toml in the project directory. pyproject.toml allows for arbitrary tool configuration in the [tool] table.

Use Case

Python projects tend to centralize tools configuration in pyproject.toml.

Proposed Solution
  • If codebook.toml or .codebook.toml are not found in the project directory, look for a pyproject.toml.
  • If [tool.codebook] exists, parse it for configuration.
  • It's expected that settings under [tool.codebook] are the same as codebook.toml root.
Alternative Solutions

No response

Examples

The README.md Configuration Options in a pyproject.toml.

[tool.codebook]
dictionaries = ["en_us", "en_gb"]
words = ["codebook", "rustc"]
flag_words = ["todo", "fixme"]
include_paths = ["src/**/*.rs", "lib/**/*.rs"]
ignore_paths = ["target/**/*", "**/*.json", ".git/**/*"]
ignore_patterns = [
    '\b[ATCG]+\b',
    '\d{3}-\d{2}-\d{4}',
    '^[A-Z]{2,}$',
    'https?://[^\s]+'
]
min_word_length = 3
use_global = true
Additional Context

Example references:

Ngôn ngữ chính
Rust
Star
925
Fork
59
Merge trung bình
53 phút
Pull request đã merge (30 ngày)
10

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 blopker/codebook

Tất cả issue của blopker/codebook

Issue tương tự

Thêm issue về Rust

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.