[prev in list] [next in list] [prev in thread] [next in thread] 

List:       buildroot
Subject:    [Buildroot] [PATCH 0/4] support ignore-indent for check-package configs
From:       James Knight <james.d.knight () live ! com>
Date:       2023-04-29 18:12:01
Message-ID: SN4P221MB068213B5F9C9C24C43CBB99AA0689 () SN4P221MB0682 ! NAMP221 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

The following series brings support for having a linter hint in
configuration files to avoid having `check-package` warn about bad
indentations for container-like configurations.

Buildroot ignores indentations for the root package configurations as
well as kodi/x11r7 packages. These configurations reference other
configurations, which makes it somewhat preferred to indent packages
under a menu option. For example:

    menu "<category>"
        source "package/<ref>/Config.in"
        ...
    endmenu

To prevent `check-package` from triggering a warning, an internal list
inside `lib_config.py` is maintained. This is less than ideal since (1)
it requires adjusting the library script if future "category"
configurations are added/removed, and (2) does not provide a way for
br2-external trees to utilize the same exceptions. For example, if a
br2-external tree manages a `Config.in` with pending upstream packages:

    menu "Target packages (Queued upstream)"
        source "$BR2_EXTERNAL_BAR_42_PATH/newpkg1/Config.in"
        source "$BR2_EXTERNAL_BAR_42_PATH/newpkg2/Config.in"
    endmenu

Utilizing Buildroot's `check-package` call on this file will generate an
indentation warning.

What this series brings is the ability to add a `ignore-indent` flag
into configuration scripts to avoid `check-package` from generating
errors for select files. Continuing with the above example, adding the
flag as follows will no longer generate an indentation error:

    # noqa: ignore-indent
    menu "Target packages (Queued upstream)"
        source "$BR2_EXTERNAL_BAR_42_PATH/newpkg1/Config.in"
        source "$BR2_EXTERNAL_BAR_42_PATH/newpkg2/Config.in"
    endmenu

This change allows dropping the internal list of configuration
exceptions (for package/Config.in, package/Config.in.host, kodi and
x11r7), to instead use the `ignore-indent` flag in the respective files.

James Knight (4):
  utils/check-package: cleanup line reading
  utils/check-package: support a file-state instance for library types
  utils/check-package: support ignore-indent flag for configurations
  utils/check-package: utilize ignore-indent flag for special configs

 package/Config.in                   |  2 ++
 package/Config.in.host              |  2 ++
 package/kodi/Config.in              |  2 ++
 package/x11r7/Config.in             |  2 ++
 utils/check-package                 | 30 ++++++++++++++++++---------
 utils/checkpackagelib/base.py       |  2 +-
 utils/checkpackagelib/lib.py        | 10 ++++-----
 utils/checkpackagelib/lib_config.py | 32 ++++++++++++++++++++---------
 utils/checkpackagelib/lib_hash.py   |  6 +++---
 utils/checkpackagelib/lib_mk.py     | 22 ++++++++++----------
 utils/checkpackagelib/lib_patch.py  |  6 +++---
 utils/checkpackagelib/lib_sysv.py   |  4 ++--
 utils/checkpackagelib/test_util.py  |  4 ++--
 13 files changed, 77 insertions(+), 47 deletions(-)

--
2.40.1.windows.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic