Skip to content

Commit

Permalink
kconfig: support plain comment in the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
suda-morris authored and ginkgm committed Feb 2, 2024
1 parent 87182c9 commit 2a6797d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 2 additions & 0 deletions components/esp_lcd/Kconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
menu "LCD and Touch Panel"
comment "LCD Touch Drivers are maintained in the IDF Component Registry"

menu "LCD Peripheral Configuration"
config LCD_PANEL_IO_FORMAT_BUF_SIZE
int "LCD panel io format buffer size"
Expand Down
21 changes: 5 additions & 16 deletions tools/kconfig_new/gen_kconfig_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,8 @@
# generated, allowing options to be referenced in other documents
# (using :ref:`CONFIG_FOO`)
#
# Copyright 2017-2020 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function

# SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import re

import kconfiglib
Expand Down Expand Up @@ -108,6 +95,8 @@ def node_is_invisible(item):
return (False, None)

def _visible(self, node):
if node.item == kconfiglib.COMMENT:
return (False, None)
if isinstance(node.item, kconfiglib.Symbol) or isinstance(node.item, kconfiglib.Choice):
dependencies = node.item.direct_dep # "depends on" for configs
name_id = node.item.name
Expand Down Expand Up @@ -159,7 +148,7 @@ def write_docs(config, visibility, filename):

def node_is_menu(node):
try:
return node.item == kconfiglib.MENU or node.is_menuconfig
return node.item in [kconfiglib.MENU, kconfiglib.COMMENT] or node.is_menuconfig
except AttributeError:
return False # not all MenuNodes have is_menuconfig for some reason

Expand Down

0 comments on commit 2a6797d

Please sign in to comment.