Skip to content

Commit 066a88e

Browse files
committed
redo PR 1235
1 parent 13eebaa commit 066a88e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

nbdev/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def _git_repo():
3535
except OSError: return
3636

3737
# %% ../nbs/api/01_config.ipynb 11
38+
# When adding a named default to the list below, be sure that that name
39+
# is also added to one of the sections in `_nbdev_cfg_sections` as well,
40+
# or it won't get written by `nbdev_create_config`:
3841
def _apply_defaults(
3942
cfg,
4043
lib_name='%(repo)s', # Package name
@@ -141,7 +144,7 @@ def _cfg2txt(cfg, head, sections, tail=''):
141144
# See https://github.com/fastai/nbdev/blob/master/settings.ini for examples.
142145
143146
'''
144-
_nbdev_cfg_sections = {'Python library': 'repo lib_name version min_python license',
147+
_nbdev_cfg_sections = {'Python library': 'repo lib_name version min_python license black_formatting',
145148
'nbdev': 'doc_path lib_path nbs_path recursive tst_flags put_version_in_init',
146149
'Docs': 'branch custom_sidebar doc_host doc_baseurl git_url title',
147150
'PyPI': 'audience author author_email copyright description keywords language status user'}

nbs/api/01_config.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@
130130
"outputs": [],
131131
"source": [
132132
"#|export\n",
133+
"\n",
134+
"# When adding a named default to the list below, be sure that that name\n",
135+
"# is also added to one of the sections in `_nbdev_cfg_sections` as well,\n",
136+
"# or it won't get written by `nbdev_create_config`:\n",
133137
"def _apply_defaults(\n",
134138
" cfg,\n",
135139
" lib_name='%(repo)s', # Package name\n",
@@ -330,7 +334,7 @@
330334
"# See https://github.com/fastai/nbdev/blob/master/settings.ini for examples.\n",
331335
"\n",
332336
"'''\n",
333-
"_nbdev_cfg_sections = {'Python library': 'repo lib_name version min_python license',\n",
337+
"_nbdev_cfg_sections = {'Python library': 'repo lib_name version min_python license black_formatting',\n",
334338
" 'nbdev': 'doc_path lib_path nbs_path recursive tst_flags put_version_in_init',\n",
335339
" 'Docs': 'branch custom_sidebar doc_host doc_baseurl git_url title',\n",
336340
" 'PyPI': 'audience author author_email copyright description keywords language status user'}\n",
@@ -790,7 +794,7 @@
790794
],
791795
"metadata": {
792796
"kernelspec": {
793-
"display_name": "Python 3",
797+
"display_name": "Python 3 (ipykernel)",
794798
"language": "python",
795799
"name": "python3"
796800
}

0 commit comments

Comments
 (0)