bazel-contrib / bazel-contrib/buildtools
Buildozer add "rename_if_exist"
Open
P3
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 471
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 13
Description
Would be great if there was a rename which doesn't error out when attr doesn't exist.
Current workaround:
```
set_if_absent old_attr INVALID
rename old_attr new_attr # NOTE errors out if old_attr is not set
remove_if_equal new_attr INVALID
```
Contributor guide
Research direction
Start by locating the existing rename command and its tests in the Buildozer codebase, then read how it handles a missing attribute. Define the new rename_if_exist behavior from the request and its workaround, and add coverage showing that an absent old_attr does not error while an existing attribute is renamed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100