Make generated warning more prominent and helpful
A number of reviews have been submitted that ignore this warning. While
we now have 01caf624211197a993dbbd186149293f7053f9d8 which will catch
these violations at CI time, that is arguably already too late, and
developers will have wasted their time.
This commit changes the warning to be multiple lines, with a caps
header, such that it's less likely to be ignored. It also adds
suggestions on how to proceed.
As a note, this also standardizes privilege registry to use the same
warning as the other files, which it didn't previously.
Tested: Comment changes only, no functional changes.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I3224130dbf581dc962187b2fde4dc98ae26de082
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 4973633..604276a 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -13,11 +13,18 @@
import xml.etree.ElementTree as ET
-REGISTRY_HEADER = '''
-/****************************************************************
+WARNING = '''/****************************************************************
+ * READ THIS WARNING FIRST
* This is an auto-generated header which contains definitions
* for Redfish DMTF defined messages.
- ***************************************************************/
+ * DO NOT modify this registry outside of running the
+ * parse_regisries.py script. The definitions contained within
+ * this file are owned by DMTF. Any modifications to these files
+ * should be first pushed to the relevant registry in the DMTF
+ * github organization.
+ ***************************************************************/'''
+
+REGISTRY_HEADER = WARNING + '''
#pragma once
#include <registries.hpp>
@@ -161,11 +168,9 @@
'privilege_registry.hpp', 'privilege')
with open(path, 'w') as registry:
registry.write("#pragma once\n")
- registry.write(
- "// {} is generated. Do not edit directly\n".format(
- os.path.basename(path)))
+ registry.write(WARNING)
- registry.write("// clang-format off\n")
+ registry.write("\n// clang-format off\n")
registry.write("\n#include <privileges.hpp>\n\n")
registry.write("namespace redfish::privileges\n")
registry.write("{\n")