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

Offen
#231 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
rust

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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:

Vorherrschende Sprache
Rust
Sterne
925
Forks
59
Ø Merge
53 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus blopker/codebook

Alle Issues in blopker/codebook

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.