a filter_global_assignment rule would serve useful in the case that rename_variables changes variable names to already existing global names. I have currently had an issue with the rename_variables rule overriding local variable names to existing global names and causing errors within my script.
It would also be a fair option to ditch this entirely for an extra parameter to also rename globals.
Examples
--unmodified
a = 0;
local b = 1;
print(a);
-- outputs: 0
-- expected output: 0
--rename_variables transform
a = 0;
local a = 1;
print(a);
-- outputs: 1
-- expected output: 0
--filter_global_assignment > rename_variables transform
getfenv().a = 0;
local a = 1;
print(getfenv().a);
-- outputs: 0
-- expected output: 0
a
filter_global_assignmentrule would serve useful in the case thatrename_variableschanges variable names to already existing global names. I have currently had an issue with therename_variablesrule overriding local variable names to existing global names and causing errors within my script.It would also be a fair option to ditch this entirely for an extra parameter to also rename globals.
Examples