]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ruff: do not warn about too long line and lambda assignment
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 21 Feb 2026 19:36:23 +0000 (04:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:32:42 +0000 (02:32 +0900)
ruff.toml
src/test/generate-sym-test.py
src/ukify/ukify.py
test/integration-tests/integration-test-wrapper.py

index d4b77fb1e724b0afe30ac471616eab13cfca682a..35a4f5dc4312e18a3f28234049c44a17fcb5d9dc 100644 (file)
--- a/ruff.toml
+++ b/ruff.toml
@@ -1,6 +1,11 @@
 target-version = "py39"
 line-length = 109
-lint.select = ["E", "F", "I", "Q", "UP"]
+
+[lint]
+select = ["E", "F", "I", "Q", "UP"]
+# E501: line-too-long
+# E731: lambda-assignment
+ignore = ["E501", "E731"]
 
 [format]
 # The formatter prefers double quotes for multiline quotes,
index aa6c916fc7c92693271a1a9230658e57337f720f..065ad14447a5e30eca339e693a0703376531df05 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 # SPDX-License-Identifier: LGPL-2.1-or-later
 #
-# ruff: noqa: E501 UP015
+# ruff: noqa: UP015
 
 import os
 import re
index 11374f607dd51dea1dcc505ba0d0045268812918..4a13019e249f1be33dae3bef1f37e3d668b65692 100755 (executable)
@@ -1109,7 +1109,7 @@ def pe_add_sections(opts: UkifyConfig, uki: UKI, output: str) -> None:
                 encoded = json.dumps(j).encode()
                 if len(encoded) > section.SizeOfRawData:
                     raise PEError(
-                        f'Not enough space in existing section .pcrsig of size {section.SizeOfRawData} to append new data of size {len(encoded)}'  # noqa: E501
+                        f'Not enough space in existing section .pcrsig of size {section.SizeOfRawData} to append new data of size {len(encoded)}'
                     )
                 section.Misc_VirtualSize = len(encoded)
                 # bytes(n) results in an array of n zeroes
@@ -1498,7 +1498,7 @@ def make_uki(opts: UkifyConfig) -> None:
 
         if names[0] != '.profile':
             raise ValueError(
-                f'Expected .profile section as first valid section in PE profile binary {profile} but got {names[0]}'  # noqa: E501
+                f'Expected .profile section as first valid section in PE profile binary {profile} but got {names[0]}'
             )
 
         if names.count('.profile') > 1:
@@ -1688,7 +1688,7 @@ def generate_keys(opts: UkifyConfig) -> None:
 
     if not work:
         raise ValueError(
-            'genkey: --secureboot-private-key=/--secureboot-certificate= or --pcr-private-key/--pcr-public-key must be specified'  # noqa: E501
+            'genkey: --secureboot-private-key=/--secureboot-certificate= or --pcr-private-key/--pcr-public-key must be specified'
         )
 
 
@@ -1879,7 +1879,7 @@ class ConfigItem:
         elif self.type:
             conv = self.type
         else:
-            conv = lambda s: s  # noqa: E731
+            conv = lambda s: s
 
         # This is a bit ugly, but --initrd and --devicetree-auto are the only options
         # with multiple args on the command line and a space-separated list in the
@@ -2116,14 +2116,14 @@ CONFIG_ITEMS = [
     ConfigItem(
         '--secureboot-private-key',
         dest='sb_key',
-        help='required by --signtool=sbsign|systemd-sbsign. Path to key file or engine/provider designation for SB signing',  # noqa: E501
+        help='required by --signtool=sbsign|systemd-sbsign. Path to key file or engine/provider designation for SB signing',
         config_key='UKI/SecureBootPrivateKey',
     ),
     ConfigItem(
         '--secureboot-certificate',
         dest='sb_cert',
         help=(
-            'required by --signtool=sbsign. sbsign needs a path to certificate file or engine-specific designation for SB signing'  # noqa: E501
+            'required by --signtool=sbsign. sbsign needs a path to certificate file or engine-specific designation for SB signing'
         ),
         config_key='UKI/SecureBootCertificate',
     ),
@@ -2132,7 +2132,7 @@ CONFIG_ITEMS = [
         dest='sb_certdir',
         default='/etc/pki/pesign',
         help=(
-            'required by --signtool=pesign. Path to nss certificate database directory for PE signing. Default is /etc/pki/pesign'  # noqa: E501
+            'required by --signtool=pesign. Path to nss certificate database directory for PE signing. Default is /etc/pki/pesign'
         ),
         config_key='UKI/SecureBootCertificateDir',
         config_push=ConfigItem.config_set,
@@ -2141,7 +2141,7 @@ CONFIG_ITEMS = [
         '--secureboot-certificate-name',
         dest='sb_cert_name',
         help=(
-            'required by --signtool=pesign. pesign needs a certificate nickname of nss certificate database entry to use for PE signing'  # noqa: E501
+            'required by --signtool=pesign. pesign needs a certificate nickname of nss certificate database entry to use for PE signing'
         ),
         config_key='UKI/SecureBootCertificateName',
     ),
@@ -2458,7 +2458,7 @@ def finalize_options(opts: argparse.Namespace) -> None:
         # both param given, infer sbsign and in case it was given, ensure signtool=sbsign
         if opts.signtool and opts.signtool not in ('sbsign', 'systemd-sbsign'):
             raise ValueError(
-                f'Cannot provide --signtool={opts.signtool} with --secureboot-private-key= and --secureboot-certificate='  # noqa: E501
+                f'Cannot provide --signtool={opts.signtool} with --secureboot-private-key= and --secureboot-certificate='
             )
         if not opts.signtool:
             opts.signtool = 'sbsign'
@@ -2478,7 +2478,7 @@ def finalize_options(opts: argparse.Namespace) -> None:
 
     if opts.sign_kernel and not opts.sb_key and not opts.sb_cert_name:
         raise ValueError(
-            '--sign-kernel requires either --secureboot-private-key= and --secureboot-certificate= (for sbsign) or --secureboot-certificate-name= (for pesign) to be specified'  # noqa: E501
+            '--sign-kernel requires either --secureboot-private-key= and --secureboot-certificate= (for sbsign) or --secureboot-certificate-name= (for pesign) to be specified'
         )
 
     opts.profile = resolve_at_path(opts.profile)
index 38d0415a1bbf2b58803aaeba1f9a8f8248d67b5c..43d11e0e2e1c011f172ce51cb75303a3b1d01967 100755 (executable)
@@ -589,7 +589,7 @@ def main() -> None:
         *(['--forward-journal', journal_file] if journal_file else []),
         *(
             [
-                '--credential', f'systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}',  # noqa: E501
+                '--credential', f'systemd.extra-unit.emergency-exit.service={shlex.quote(EMERGENCY_EXIT_SERVICE)}',
                 '--credential', f'systemd.unit-dropin.emergency.target={shlex.quote(EMERGENCY_EXIT_DROPIN)}',
             ]
             if not sys.stdin.isatty()
@@ -700,7 +700,7 @@ def main() -> None:
             iter = os.environ['GITHUB_RUN_ATTEMPT']
             runner = os.environ['TEST_RUNNER']
             artifact = (
-                f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-{runner}-failed-test-journals'  # noqa: E501
+                f'ci-{wf}-{id}-{iter}-{summary.distribution}-{summary.release}-{runner}-failed-test-journals'
             )
             ops += [f'gh run download {id} --name {artifact} -D ci/{artifact}']
             journal_file = Path(f'ci/{artifact}/test/journal/{name}.journal')