@@ -988,21 +988,19 @@ class TestNameConstant(TestSpec):
988988 """Test constexpr constant names."""
989989
990990 name = "name/constexpr-constant"
991- message = (
992- 'Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".'
993- )
991+ message = "Use UpperCamelCase for names of constexpr constants."
994992 rationale = rationale_names
995993 references = references_names
996994 suffixes = [".h" , ".cxx" , ".C" ]
997995
998996 def __init__ (self ) -> None :
999997 super ().__init__ ()
1000998 keyword = r"(.+ )" # e.g. "static "
1001- type_val = r"([\w:<>+\-*\/, ]+ )" # value type e.g. "std::array<Type, n + 1> "
999+ type_val = r"([\w:<>+\-*\/, ]+ )" # value type e.g. "std::array<Type, n + 1> "
10021000 prefix = r"(\w+::)" # prefix with namespace or class, e.g. "MyClass::"
10031001 name_val = r"(\w+)" # name of the constant
1004- array = r"(\[.*\])" # array declaration: "[...]"
1005- assignment = r"( =|\(\d|{)" # value assignment, e.g. " = 2", " = expression", "(2)", "{2}", "{{...}}"
1002+ array = r"(\[.*\])" # array declaration: "[...]"
1003+ assignment = r"( =|\(\d|{)" # value assignment, e.g. " = 2", " = expression", "(2)", "{2}", "{{...}}"
10061004 self .pattern = re .compile (rf"{ keyword } ?constexpr { type_val } ?{ prefix } *{ name_val } { array } ?{ assignment } " )
10071005
10081006 def test_line (self , line : str ) -> bool :
@@ -1013,8 +1011,6 @@ def test_line(self, line: str) -> bool:
10131011 return True
10141012 constant_name = match .group (4 )
10151013 # The actual test comes here.
1016- if constant_name .startswith ("k" ) and len (constant_name ) > 1 : # exception for special constants
1017- constant_name = constant_name [1 :] # test the name without "k"
10181014 return is_upper_camel_case (constant_name )
10191015
10201016
@@ -1785,7 +1781,9 @@ def main():
17851781 print ("Skipping writing in GITHUB_OUTPUT." )
17861782
17871783 # Print tips.
1788- print ("\n Tip: You can run the O2 linter locally from the O2Physics directory with: python3 Scripts/o2_linter.py <files>" )
1784+ print (
1785+ "\n Tip: You can run the O2 linter locally from the O2Physics directory with: python3 Scripts/o2_linter.py <files>"
1786+ )
17891787
17901788 if not passed :
17911789 sys .exit (1 )
0 commit comments