@@ -111,23 +111,24 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
111111 See https://needs-config-writer.useblocks.com
112112 """
113113
114+ # Write to the confdir directory.
114115 config_setdefault (app .config , "needscfg_outpath" , "ubproject.toml" )
115- """Write to the confdir directory."""
116116
117+ # Any changes to the shared/local configuration updates the generated config.
117118 config_setdefault (app .config , "needscfg_overwrite" , True )
118- """Any changes to the shared/local configuration updates the generated config."""
119119
120+ # Write full config, so the final configuration is visible in one file.
120121 config_setdefault (app .config , "needscfg_write_all" , True )
121- """Write full config, so the final configuration is visible in one file."""
122122
123+ # Exclude default values from the generated configuration.
123124 config_setdefault (app .config , "needscfg_exclude_defaults" , True )
124- """Exclude default values from the generated configuration."""
125125
126126 # This is disabled for right now as it causes a lot of issues
127127 # While we are not using the generated file anywhere
128+ # Running Sphinx with -W will fail the CI for uncommitted TOML changes.
128129 config_setdefault (app .config , "needscfg_warn_on_diff" , False )
129- """Running Sphinx with -W will fail the CI for uncommitted TOML changes."""
130130
131+ # Exclude resolved/generated config values that don't belong in ubproject.toml.
131132 app .config .needscfg_exclude_vars = [
132133 # Default exclusions from needs-config-writer
133134 "needs_from_toml" ,
@@ -142,12 +143,11 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
142143 # needs_config_writer emits unsupported_type warnings for these and skips them.
143144 "needs_render_context" ,
144145 ]
145- """Exclude resolved/generated config values that don't belong in ubproject.toml."""
146146
147+ # Merge the static TOML file into the generated configuration.
147148 app .config .needscfg_merge_toml_files .append (
148149 str (Path (__file__ ).parent / "shared.toml" )
149150 )
150- """Merge the static TOML file into the generated configuration."""
151151
152152 # Generate TOML fragments for types, fields, and links from the metamodel.
153153 # needs_config_writer cannot serialise these structures itself, so we combine
@@ -163,9 +163,10 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
163163 mode = "w" , suffix = ".toml" , delete = False , encoding = "utf-8"
164164 ) as tmp :
165165 tmp .write (metamodel_toml )
166+ # Merge the generated metamodel TOML (types, fields, links) into the final ubproject.toml.
166167 app .config .needscfg_merge_toml_files .append (tmp .name )
167- """Merge the generated metamodel TOML (types, fields, links) into the final ubproject.toml."""
168168
169+ # Relative paths to confdir for Bazel provided absolute paths.
169170 app .config .needscfg_relative_path_fields .extend (
170171 [
171172 "needs_external_needs[*].json_path" ,
@@ -175,7 +176,6 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
175176 },
176177 ]
177178 )
178- """Relative paths to confdir for Bazel provided absolute paths."""
179179
180180 app .config .suppress_warnings += [
181181 "needs_config_writer.path_conversion" ,
0 commit comments