mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-12 09:04:37 +02:00
confgen: Avoid including invisible (due to target) choice items in kconfig.rst renames
This commit is contained in:
committed by
Angus Gratton
parent
eb85cfb9f6
commit
ac8e931179
@@ -115,7 +115,16 @@ class DeprecatedOptions(object):
|
|||||||
def append_doc(self, config, visibility, path_output):
|
def append_doc(self, config, visibility, path_output):
|
||||||
|
|
||||||
def option_was_written(opt):
|
def option_was_written(opt):
|
||||||
return any(visibility.visible(node) for node in config.syms[opt].nodes)
|
# named choices were written if any of the symbols in the choice were visible
|
||||||
|
if new_opt in config.named_choices:
|
||||||
|
syms = config.named_choices[new_opt].syms
|
||||||
|
for s in syms:
|
||||||
|
if any(visibility.visible(node) for node in s.nodes):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
# otherwise if any of the nodes associated with the option was visible
|
||||||
|
return any(visibility.visible(node) for node in config.syms[opt].nodes)
|
||||||
|
|
||||||
if len(self.r_dic) > 0:
|
if len(self.r_dic) > 0:
|
||||||
with open(path_output, 'a') as f_o:
|
with open(path_output, 'a') as f_o:
|
||||||
@@ -123,7 +132,7 @@ class DeprecatedOptions(object):
|
|||||||
f_o.write('.. _configuration-deprecated-options:\n\n{}\n{}\n\n'.format(header, '-' * len(header)))
|
f_o.write('.. _configuration-deprecated-options:\n\n{}\n{}\n\n'.format(header, '-' * len(header)))
|
||||||
for dep_opt in sorted(self.r_dic):
|
for dep_opt in sorted(self.r_dic):
|
||||||
new_opt = self.r_dic[dep_opt]
|
new_opt = self.r_dic[dep_opt]
|
||||||
if new_opt not in config.syms or (config.syms[new_opt].choice is None and option_was_written(new_opt)):
|
if option_was_written(new_opt) and (new_opt not in config.syms or config.syms[new_opt].choice is None):
|
||||||
# everything except config for a choice (no link reference for those in the docs)
|
# everything except config for a choice (no link reference for those in the docs)
|
||||||
f_o.write('- {}{} (:ref:`{}{}`)\n'.format(config.config_prefix, dep_opt,
|
f_o.write('- {}{} (:ref:`{}{}`)\n'.format(config.config_prefix, dep_opt,
|
||||||
config.config_prefix, new_opt))
|
config.config_prefix, new_opt))
|
||||||
|
Reference in New Issue
Block a user