Fixes #5058: add method to ensure lhs=rhs in files