get2knowio / get2knowio/remo

Replace eval-based array access in build_tool_args with namerefs

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
tech-debt
Dominant language
Python
Stars
2
Forks
0
Avg merge
15h 59m
Merged PRs (30d)
9

Description

## Description

`build_tool_args()` uses `eval` to access array elements by name for bash 3.2 compatibility:

```bash
eval "only_size=\${#${only_name}[@]}"
eval "val=\${${only_name}[$i]}"
```

Since we target bash 4+ (Linux servers), this can be replaced with `declare -n` (namerefs) for safer code:

```bash
declare -n only_ref="$only_name"
declare -n skip_ref="$skip_name"
for val in "${only_ref[@]}"; do ...
```

## Priority

Low — eval usage is internal and not exposed to user input.

Contributor guide

Open the contributing guide

Research direction

Search for the build_tool_args() entry point and inspect how it currently uses eval to access named arrays. Confirm the project’s Bash 4+ target before making the change, then verify that array arguments are still passed correctly without eval; the issue does not name a specific test or file to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
tooling
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.