Output summary at the end of execution
When Piranha is run, output the summary of the run that includes the configuration under which it ran, the number of APIs considered for refactoring, the number of APIs refactored, etc. Related - issue #207
hii..I am trying to integrate piranha using maven.Also I have configured all the required jar files inside pom.xml file.Also the maven test result is getting successful.But where can I get the expected output?? I m not able to analyse where the output is generated.Please help me with this
When you build it with the given options in the instruction, the refactoring should happen in place and whatever you provided as source must have been updated.
Thanks for quick response...actually the source is not getting updated. I am running by project->Run As->maven test.Also tried with pom.xml->Run As->maven test.Is this the correct approach? can you please guide me , which one to run?
Almost reached the solution referring the previous solutions to the issue raised
Glad it’s almost working! Two tips for the future:
-
If you’re having a problem with Piranha, please either open a new issue or comment on an issue reflecting the same problem. This issue is about something different.
-
If you’re having a build system integration problem, please provide output from running on the command line. Unfortunately we don’t have time to support IDE integrations at the moment.
yes sure...thanks for info :)
It would also be helpful to output "near misses" during execution. Makes it easier to identify if the returnType or receiverType is slightly off, for instance. Or if the properties file path was specified incorrectly.
Does it make sense to log these in an optionally specified file or would that be too much overhead?
Great idea. We can do two things here: a) By default, we will print the summary of what happened as part of the refactoring. b) Optionally, if the user specifies an option, we can log the activity of the refactoring process at the appropriate granularity.
The latter will be more expensive but will only be used for debugging the process of refactoring.
Could this also work independently from the in-place removals?
That is, run Piranha and only get this summary, and don't modify any files.
Yes. Polyglot Piranha allows one to express match-only rules (That change is under PR now) . So we can get this summary without replacements too.
❤️. Can we expect this sometime this year?
Oh yea ! My plan is to do it much much sooner. This is also an internal requirement so ...
@j1nma I have added the functionality you requested for. Can you try now?
Basically you have to create match-only rules for your feature flag API.
So u can build upon stale_feature_flag_cleanup_demos and match_only_demos.
Tip: You can convert the stale_feature_flag_cleanup_demos to just return you the matches (Without rewriting the code) by deleting the rules.replace and rules.replace_node.