Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a toml esq configuration reader and writer #620

Merged
merged 48 commits into from
Mar 13, 2025
Merged

Add a toml esq configuration reader and writer #620

merged 48 commits into from
Mar 13, 2025

Conversation

GregHib
Copy link
Owner

@GregHib GregHib commented Mar 13, 2025

After consideration about yaml in #618 I wrote a toml parser but it wasn't as performant as I would've liked. I came up with a few improvements over the current yaml parser I had. Namely: parsing numbers by hand and managing & reading everything as bytes rather than char arrays.
My first implementation highlighted the complexity and weird edge case design decisions for toml, like supporting a flexible version of RFC 3339 dates rather than ISO 8601, allowing multi-line arrays but not multi-line maps, and not having a way to reduce duplication of table headers.

I addressed this by implementing my own syntax, removing the complexities for my use-case and adding a select few improvements. It's closer in style to .ini than .toml but is both more limited and more expressive than either.

Copy link

github-actions bot commented Mar 13, 2025

Qodana Community for JVM

11 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 11

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link

codecov bot commented Mar 13, 2025

Codecov Report

Attention: Patch coverage is 60.68111% with 127 lines in your changes missing coverage. Please review.

Project coverage is 35.70%. Comparing base (af9f9ac) to head (fbc18b7).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...src/main/kotlin/world/gregs/config/ConfigReader.kt 79.14% 14 Missing and 25 partials ⚠️
...ig/src/main/kotlin/world/gregs/config/ConfigMap.kt 0.00% 34 Missing ⚠️
...src/main/kotlin/world/gregs/config/ConfigWriter.kt 58.53% 14 Missing and 20 partials ⚠️
...onfig/src/main/kotlin/world/gregs/config/Config.kt 0.00% 20 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...onfig/src/main/kotlin/world/gregs/config/Config.kt 0.00% <0.00%> (ø)
...ig/src/main/kotlin/world/gregs/config/ConfigMap.kt 0.00% <0.00%> (ø)
...src/main/kotlin/world/gregs/config/ConfigWriter.kt 58.53% <58.53%> (ø)
...src/main/kotlin/world/gregs/config/ConfigReader.kt 79.14% <79.14%> (ø)

... and 24 files with indirect coverage changes

@@             Coverage Diff              @@
##               main     #620      +/-   ##
============================================
+ Coverage     35.44%   35.70%   +0.26%     
- Complexity     4919     4932      +13     
============================================
  Files          1352     1356       +4     
  Lines         47930    48253     +323     
  Branches       9663     9718      +55     
============================================
+ Hits          16989    17231     +242     
- Misses        27497    27578      +81     
  Partials       3444     3444              
Components Coverage Δ
Content 30.08% <ø> (+0.01%) ⬆️
Engine 43.37% <ø> (+0.24%) ⬆️
Network 71.90% <ø> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GregHib GregHib merged commit f1aa291 into main Mar 13, 2025
5 checks passed
@GregHib GregHib deleted the toml branch March 13, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant