New rule: Calling File.append() more than once or in a loop
Brought to you by:
chrismair
This is from a Tweet from Tim Yates (tim_yates) – Feb 24, 2011: “There should be a codenarc rule about calling #groovy File.append more than once on the same file or in a loop (use withWriterAppend)”.
It's a good idea, but it will be tricky, I think, to determine that you are calling append() on a File object, given our limited AST level.
Also note (from duplicate issue #3370221):
This opens and closes the file every time. Beware, the << operator is a file append too!