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

Merge overrides settings if values are dicts #188

Merged
merged 4 commits into from
Jul 8, 2021

Conversation

goanpeca
Copy link
Member

@goanpeca goanpeca commented Jul 7, 2021

Fixes jupyterlab/jupyterlab#10010

When using overrides files, if a default value in a schema is a dict then it will update the default with the dict provided by the overrides file.

With overrides.json

{
  "@jupyterlab/notebook-extension:tracker": {
      "codeCellConfig": {
         "lineNumbers": false
      }
  }
}

Before this change

The resulting system default settings would be:

{
    // Notebook
    // @jupyterlab/notebook-extension:tracker
    // Notebook settings.
    // **************************************

    // Code Cell Configuration
    // The configuration for all code cells.
    "codeCellConfig": {
        "lineNumbers": false,
    },
....

After this change

The resulting system default settings would be:

{
    // Notebook
    // @jupyterlab/notebook-extension:tracker
    // Notebook settings.
    // **************************************

    // Code Cell Configuration
    // The configuration for all code cells.
    "codeCellConfig": {
        "autoClosingBrackets": true,
        "cursorBlinkRate": 530,
        "fontFamily": null,
        "fontSize": null,
        "lineHeight": null,
        "lineNumbers": false,
        "lineWrap": "off",
        "matchBrackets": true,
        "readOnly": false,
        "insertSpaces": true,
        "tabSize": 4,
        "wordWrapColumn": 80,
        "rulers": [],
        "codeFolding": false,
        "lineWiseCopyCut": true
    },
....

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2021

Codecov Report

Merging #188 (570e2b5) into master (6ecc630) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #188      +/-   ##
==========================================
+ Coverage   78.55%   78.70%   +0.14%     
==========================================
  Files          27       27              
  Lines        1996     2010      +14     
==========================================
+ Hits         1568     1582      +14     
  Misses        428      428              
Impacted Files Coverage Δ
jupyterlab_server/settings_handler.py 85.45% <100.00%> (+0.26%) ⬆️
jupyterlab_server/tests/test_settings_api.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ecc630...570e2b5. Read the comment docs.

@goanpeca
Copy link
Member Author

goanpeca commented Jul 7, 2021

The errors seem unrelated to the changes on this PR.

+ make html
Running Sphinx v4.0.3

Exception occurred:
  File "/usr/local/miniconda/envs/jupyterlab_server_documentation/lib/python3.8/site-packages/autodoc_traits/autodoc_traits.py", line 2, in <module>
    from sphinx.domains.python import PyClassmember
ImportError: cannot import name 'PyClassmember' from 'sphinx.domains.python' (/usr/local/miniconda/envs/jupyterlab_server_documentation/lib/python3.8/site-packages/sphinx/domains/python.py)
The full traceback has been saved in /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/sphinx-err-zqiolyd7.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 2

@goanpeca goanpeca changed the title Merge overrides settings if dicts Merge overrides settings if values are dicts Jul 7, 2021
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 merged commit 52f4cf9 into jupyterlab:master Jul 8, 2021
@goanpeca goanpeca deleted the enh/merge-override-dicts branch August 3, 2021 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cascading Schemas
3 participants