Is there a way in IntelliJ Idea to force this. to be automatically placed into code on a format or save or at the very least show an error if it should be in there?
There is a code inspection option available for this (File > Settings > Editor > Inspections):
File > Settings > Editor > Inspections
You can turn this inspection on to get warnings.
The code cleanup option can be used from menu (Analyze > Code Cleanup...)
Analyze > Code Cleanup...