This function is generally applicable to Ruby, not just handling linter output.
Ruumba provides RuboCop linting for ERB templates. https://github.com/ericqweinstein/ruumba