fix: don't duplicate comments in attributes (#18636)