feat: add TOML config parser #2

Open
zoeyfyi wants to merge 1 commit from feat/config-parser into main
Owner

Introduces a typed config parser using dataclasses.

  • Reads from TOML files
  • Provides sensible defaults
  • Falls back gracefully if config file is missing
Introduces a typed config parser using dataclasses. - Reads from TOML files - Provides sensible defaults - Falls back gracefully if config file is missing
Author
Owner

Nice use of dataclasses! One thought: we should validate that port is within a valid range (1-65535).

Nice use of dataclasses! One thought: we should validate that `port` is within a valid range (1-65535).
Author
Owner

The tomli fallback for Python < 3.11 is a nice touch 👍

The `tomli` fallback for Python < 3.11 is a nice touch 👍
Author
Owner

Should we add environment variable overrides? e.g. APP_PORT=9090 takes precedence over the config file.

Should we add environment variable overrides? e.g. `APP_PORT=9090` takes precedence over the config file.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/config-parser:feat/config-parser
git switch feat/config-parser

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/config-parser
git switch feat/config-parser
git rebase main
git switch main
git merge --ff-only feat/config-parser
git switch feat/config-parser
git rebase main
git switch main
git merge --no-ff feat/config-parser
git switch main
git merge --squash feat/config-parser
git switch main
git merge --ff-only feat/config-parser
git switch main
git merge feat/config-parser
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoeyfyi/test-repo!2
No description provided.