Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //src:license-checkStatus: Click to expand output |
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Some questions that came to mind.
But overall looks like a good approach. 💯
| **sphinx_options.needs_global_options, | ||
| **app.config.needs_global_options, | ||
| } | ||
| config_setdefault(app.config, "html_theme", html_options.html_theme) |
There was a problem hiding this comment.
A bit confused why this is only used here?
Will the unpacking via ** what will happen if keys are already there? Would it not error?
|
|
||
| puml = score_layout_path / "assets" / "puml-theme-score.puml" | ||
| app.config.needs_flow_configs = {"score_config": f"!include {puml}"} | ||
| app.config.needs_flow_configs.setdefault("score_config", f"!include {puml}") |
There was a problem hiding this comment.
Is this just .setdefault ? Instead of config_setdefault?
| app.config.source_suffix.setdefault(".rst", "restructuredtext") | ||
| app.config.source_suffix.setdefault(".md", "markdown") |
There was a problem hiding this comment.
Also 'setdefault' instead of config_setdefault?
| if "templates" not in app.config.templates_path: | ||
| app.config.templates_path += ["templates"] |
There was a problem hiding this comment.
This would then add templates to it even if there are none there or they are somewher else for the user no?
Would it not be better to have it be only set if it's empty?
| def test_config_setdefault_sets_when_not_in_raw_config(): | ||
| cfg = _FakeConfig(raw={}) | ||
| config_setdefault(cfg, "html_copy_source", False) # pyright: ignore [reportArgumentType] | ||
| assert cfg.html_copy_source is False # pyright: ignore [reportAttributeAccessIssue] | ||
|
|
||
|
|
||
| def test_config_setdefault_does_not_overwrite_user_value(): | ||
| cfg = _FakeConfig(raw={"html_copy_source": True}) | ||
| cfg.html_copy_source = True # pyright: ignore[reportAttributeAccessIssue] | ||
| config_setdefault(cfg, "html_copy_source", False) # pyright: ignore [reportArgumentType] | ||
| assert cfg.html_copy_source is True # pyright: ignore[reportAttributeAccessIssue] |
There was a problem hiding this comment.
Should we really ignore all of the warnings here?
I guess for tests it isn't as severe as for normal code.
|
Also error in the build documentation: |
📌 Description
Don't blindly overwrite user configuration.
Instead set configuration only when not set before.
🚨 Impact Analysis
✅ Checklist