You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rule #1 delete_enum_declaration - deletes the enum entry using the string "FEATURE-A-ENABLED" , since it's a seed rule I can use the @flag_enum_name in the subsequent non-seed rules
rule #2 replace_flag_method_declaration - deletes one-line functions which are using the FEATURE_A enum entry, in order to use @flag_enum_name from the previous rule this rule must be declared as is_seed_rule = false
As you can see the enum entry and the function declaration isFeatureEnabled are deleted. I want also to replace invocation of isFeatureEnabled() with boolean literal
But from the rules perspective I don't understand how can I accomplish that, since the second rule which matches function declarations - is not a seed rule - so I can't add @function_name to the hole of the 3rd rule. Also I cannot make the 2nd rule as seed, since I need the @ flag_enum_name to identify such functions.
I hope I explained it clearly. I would be appreciated for your help.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @aleksandr-zakshevskii-n26. Have you tried adding an edge from the 2nd rule to the 3rd rule? In general, if you have rules a and b, and an edge a -> b, you can use matches from a as holes in b.
Hello, I wanted to get your advice on how to treat the following case,
we have a feature flag which is called
FEATURE-A-ENABLED
the code which is using the feature flag:
Ideally i would like to remove usages of
FEATURE_A
enum entry andisFeatureEnabled()
invocationsInitially I tried adding the following rules:
rule #1
delete_enum_declaration
- deletes the enum entry using the string"FEATURE-A-ENABLED"
, since it's a seed rule I can use the@flag_enum_name
in the subsequent non-seed rulesrule #2
replace_flag_method_declaration
- deletes one-line functions which are using theFEATURE_A
enum entry, in order to use@flag_enum_name
from the previous rule this rule must be declared asis_seed_rule = false
After running those 2 rules - I get the following result:
As you can see the enum entry and the function declaration
isFeatureEnabled
are deleted. I want also to replace invocation ofisFeatureEnabled()
with boolean literalBut from the rules perspective I don't understand how can I accomplish that, since the second rule which matches function declarations - is not a seed rule - so I can't add
@function_name
to the hole of the 3rd rule. Also I cannot make the 2nd rule as seed, since I need the@ flag_enum_name
to identify such functions.I hope I explained it clearly. I would be appreciated for your help.
Thanks!
The text was updated successfully, but these errors were encountered: