bazel-contrib / bazel-lib

Common useful functions for writing BUILD files and Starlark macros/rules
Apache License 2.0
140 stars 90 forks source link

fix: correctly split quoted args #909

Closed gregmagolan closed 3 months ago

gregmagolan commented 3 months ago

Fixes https://github.com/aspect-build/bazel-lib/issues/891 (requested by Bazel Open Source Support customer).


Changes are visible to end-users: yes

New function split_args is added to the public API of strings.bzl.

This fix touches a number of different rules:

Test plan

Unit tests added for the new split_args function that handles parsing args and splitting them taking into account single quotes, double quotes and escapes.

aspect-workflows[bot] commented 3 months ago

Test

1 test target passed

Targets
//docs:update_29_test [k8-fastbuild] 69ms

Total test execution time was 69ms. 220 tests (99.5%) were fully cached saving 30s.


Test

e2e/copy_action

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/copy_to_directory

All tests were cache hits

6 tests (100.0%) were fully cached saving 750ms.


Test

e2e/coreutils

All tests were cache hits

4 tests (100.0%) were fully cached saving 742ms.


Test

e2e/external_copy_to_directory

All tests were cache hits

1 test (100.0%) was fully cached saving 59ms.


Test

e2e/smoke

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.


Buildifier      Format      Gazelle