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

other: group together config file options and refactor #1396

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Jan 23, 2024

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

Groups together similar config file options. This is a breaking change, and breaks all current config files!

I also took this time to completely redo how configs and args are handled, which cleans up a lot of code and reduces a bunch of duplicate definitions and sketchy code.

TODO before merging:

  • Update default config file. Potentially make this autogen rather than a giant constant str.
  • Merge together a few duplicate categories. For example, filters, or style.
    • For colours/styles, make custom palettes an enum struct so it's only used if we set a custom palette.
  • (Maybe in future PR) Clean up existing code and tests! A lot of this is very messy.
  • (Maybe in future PR) Add auto migration tool.
  • Update all docs. Add photos of schema usage as well, as follow-up to other: add json schema #1394.
  • Update schema. Furthermore, in the future. Probably worth keeping + publishing the existing one as "v1" or something as follow-up to other: add json schema #1394, and the new one as nightly (and v2 on deploy). Done
    • On that note, also gotta figure out how we're doing versioning, then! Done

Issue

If applicable, what issue does this address?

Closes: #

Testing

If relevant, please state how this was tested. All changes must be tested to work:

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch from fb27962 to 557cbed Compare January 24, 2024 08:59
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: Patch coverage is 79.03431% with 165 lines in your changes are missing coverage. Please review.

Project coverage is 53.52%. Comparing base (79969c7) to head (4453eaa).
Report is 26 commits behind head on main.

❗ Current head 4453eaa differs from pull request most recent head 9a04ad5. Consider uploading reports for the commit 9a04ad5 to get more accurate results

Files Patch % Lines
src/options/config/general.rs 1.78% 55 Missing ⚠️
src/options/config.rs 30.66% 52 Missing ⚠️
src/options.rs 89.65% 27 Missing ⚠️
src/options/config/process.rs 57.89% 8 Missing ⚠️
src/options/config/cpu.rs 0.00% 7 Missing ⚠️
src/options/args.rs 95.55% 4 Missing ⚠️
src/options/config/battery.rs 33.33% 2 Missing ⚠️
src/options/config/gpu.rs 66.66% 2 Missing ⚠️
src/options/config/memory.rs 33.33% 2 Missing ⚠️
src/options/config/network.rs 33.33% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1396      +/-   ##
==========================================
- Coverage   55.96%   53.52%   -2.45%     
==========================================
  Files         102      109       +7     
  Lines       18381    17966     -415     
==========================================
- Hits        10287     9616     -671     
- Misses       8094     8350     +256     
Flag Coverage Δ
macos-12 36.31% <78.90%> (-3.16%) ⬇️
ubuntu-latest 56.08% <78.90%> (-2.49%) ⬇️
windows-2019 36.40% <79.03%> (-3.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch 6 times, most recently from 00d6a5e to 10502e1 Compare January 29, 2024 01:11
@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch 10 times, most recently from 1ad7e8e to 36be1a0 Compare February 4, 2024 23:44
@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch 2 times, most recently from c7aa9ed to e81af48 Compare February 16, 2024 01:20
@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch 2 times, most recently from a2bcab3 to 68e61da Compare February 18, 2024 08:23
@ClementTsang ClementTsang force-pushed the simplify_options_and_args_merging branch from 68e61da to 4453eaa Compare February 20, 2024 01:09
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.

None yet

1 participant