Enable H501: do not use locals() for formatting

Change-Id: I8b63c76b50cb3bb74b136678a945df79eb19856e
Merge "Enable H501: do not use locals() for formatting"