conda / conda/constructor

Improve variable and function names in NSIS templates

Open
#1,110 1 comment 0 reactions 0 assignees View on GitHub
type::feature
Dominant language
Python
Stars
497
Forks
181
Avg merge
1d 16h
Merged PRs (30d)
17

Description

### Checklist

- [x] I added a descriptive title
- [x] I searched open requests and couldn't find a duplicate

### What is the idea?

In the NSIS templates there are a lot of variables and functions such as `Ana_*` This looks like a legacy thing and doesn't really serve any purpose, it makes the code look less attractive. In the PR [here](https://github.com/conda/constructor/pull/1105) some variables were renamed to improve readability. We should update the rest of the code base and improve it in a similar fashion to make it consistent.

### Why is this needed?

This would mainly benefit developers of `constructor` and intends to improve code readability.

### What should happen?

Variable and function names with the pattern `*Ana*` for example:
1. `Function mui_AnaCustomOptions_Show`
2. `Var Ana_PreInstall_State`
to be renamed
3. Fix inconsistencies in initialization of variables. For example, the following code can likely be moved into `mui_AnaCustomOptions_InitDefaults`:
```
StrCpy $Ana_ClearPkgCache_State {{ '${BST_UNCHECKED}' if keep_pkgs else '${BST_CHECKED}' }}
StrCpy $Ana_PreInstall_State {{ '${BST_CHECKED}' if pre_install_exists else '${BST_UNCHECKED}' }}
StrCpy $Ana_PostInstall_State {{ '${BST_CHECKED}' if post_install_exists else '${BST_UNCHECKED}' }}
```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.