bazelbuild / bazelbuild/bazel-skylib

Provide a `lists` module.

Open
#422 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
444
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I have a Starlark `lists` module with several functions that make working with `list` values a little eaiser. I am willing to contribute it to `bazel-skylib` as the functionality seems generally useful.

Current functions:
- `compact`: Given a `list`, return a new `list` having removed the items that equal `None`.
- `contains`: It has two modes.
- Given a `list` and a `bool` function (i.e., accepts a single parameter and returns a `bool`), it will return `True` if any of the items in the list satisfy the function.
- Given a `list` and any other type, it will return `True` if any of the items equal the input.
- `find`: Given a list and a `bool` function, it will return the item that satisfies the function.
- `flatten`: Given a `list` that may contain items that are `list` values, it returns a `list` with all of the items flattened (i.e., no items in the result are an item of type `list`).

If the code owners are agreeable, I am willing to put up one or more PRs.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reviewing existing bazel-skylib modules and their testing conventions, then confirm the proposed semantics for compact, contains, find, and flatten. Done means an agreed lists module with those functions and tests covering their stated behaviors.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.