Repository navigation
refactor(config): split ParseConfig into tokenise, dispatch, clamp and sanitize helpers - #480
Merged
Merged
Conversation
…Binds (#475) Move-only: the lines are unchanged and run at the same point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
Move-only: the lines are unchanged and run at the same point, before SanitizeBinds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…lueKey (#475) Move-only (re-indented): both if/else chains keep every key's parser and order. The try/catch stays in ParseConfig, so a throw still skips the rest and keeps the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
…yEmptyableKey (#475) Move-only apart from 'continue' becoming 'return true' (the caller continues on true) and the two comments that said 'below' now naming ParseConfig / ApplyValueKey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
#475) Move-only apart from 'continue' becoming 'return false' and the key/val declarations becoming assignments to the out parameters (the caller declares them per line, as before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #475
Splits
ParseConfig(src/config.cpp, about 260 lines) into static helpers. Move-only, no behaviour change: every key keeps the same parser and clamp, the passes run in the same order, the try/catch stays inParseConfig.Extracted functions (
src/config.cpp, line ranges after this PR)SanitizeBinds(Config&)ClampConfig(Config&, bool haveRenderScaling)ApplyValueKey(Config&, key, val, bool& haveRenderScaling)ApplyEmptyableKey(Config&, key, val)engine*keys that accept an empty valueSplitIniLine(line, key&, val&)ParseConfig(what is left)One commit per extraction; review with
git diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change.How move-only was checked
A moved-lines diff against
origin/main(removed vs added lines as a multiset, indentation ignored). The only lines that are not pure moves:continue->return trueinApplyEmptyableKey(the caller continues on true) andcontinue->return falseinSplitIniLine(the caller continues on false);std::string key = .../std::string val = ...-> assignments to out parameters (the caller declareskey, valper line);ParseConfig/ApplyValueKey.Deliberately not done
txSamplingModefolding,renderScalingflag,outlineColorpre-parse, the*Onswitches,hitchThresholdPctclamp-at-parse), and the review leaves this to the separate config-registry (X-macro) decision.ParseConfig); not reordered to keep the diff a clean move.Gates
build.bat check: pass (only the pre-existingfopenC4996 warnings)build.bat test: 643/643 test cases, 98941 assertions, exit 0 (tests/test_config_defaults.cppandtests/fixtures/config_defaults.txtunchanged)build.bat: linksWind.exeandWindTray.exesrc/config_uiuntouched, so nobuild.bat config/ Playwright run.Docs:
docs/architecture/08-config-profiles.md(Parsing) now names the helpers;09-settings-ui.mdpoints a new setting atApplyValueKey.🤖 Generated with Claude Code
https://claude.ai/code/session_01TdjopXZfsUiesYxYLYHEdH