]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generate-gperfs: apply "ruff format"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 19 Feb 2026 17:10:14 +0000 (02:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:44:47 +0000 (02:44 +0900)
tools/generate-gperfs.py

index fc349b43faed5cd2d44bfab9106bbcf5b0319891..e9e520247eb20e562205432573bcd2116bcafad6 100755 (executable)
@@ -13,23 +13,23 @@ if __name__ == '__main__':
         sys.exit(f'Usage: {sys.argv[0]} name prefix file [includes...]')
 
     name, prefix, file, *includes = sys.argv[1:]
-    includes = [f"#include {i}" for i in includes]
+    includes = [f'#include {i}' for i in includes]
 
     # Older versions of python don't allow backslashes
     # in f-strings so use chr(10) for newlines and chr(92)
     # for backslashes instead as a workaround.
-    print(f"""\
+    print(f'''\
 %{{
 _Pragma("GCC diagnostic ignored {chr(92)}"-Wimplicit-fallthrough{chr(92)}"")
 #if __GNUC__ >= 15
 _Pragma("GCC diagnostic ignored {chr(92)}"-Wzero-as-null-pointer-constant{chr(92)}"")
 #endif
 {chr(10).join(includes)}
-%}}""")
-    print(f"""\
+%}}''')
+    print(f'''\
 struct {name}_name {{ const char* name; int id; }};
 %null-strings
-%%""")
+%%''')
 
     for line in open(file):
-        print("{0}, {1}{0}".format(line.rstrip(), prefix))
+        print('{0}, {1}{0}'.format(line.rstrip(), prefix))