diff --git a/pyproject.toml b/pyproject.toml index b58fd54efbef6..c7f94c3d27040 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,15 +46,13 @@ lint.ignore = [ "undocumented-magic-method", "undocumented-public-nested-class", "undocumented-public-init", - "incorrect-blank-line-before-class", - "multi-line-summary-second-line", + "incorrect-blank-line-before-class", # Superceeded by no-blank-line-before-class + "multi-line-summary-second-line", # Superceeded by multi-line-summary-first-line "non-imperative-mood", "assert-false", # See https://github.com/PyCQA/flake8-bugbear/issues/66 "function-uses-loop-variable", "star-arg-unpacking-after-keyword-arg", - "multiple-spaces-before-keyword", "module-import-not-at-top-of-file", - "multiple-spaces-after-comma", "multiple-leading-hashes-for-block-comment", "line-too-long", "type-comparison", @@ -79,17 +77,16 @@ lint.ignore = [ "redefined-loop-name", "mutable-class-default", "unnecessary-iterable-allocation-for-first-element", - "missing-f-string-syntax", "unraw-re-pattern", "non-empty-init-module", - "format-literals", # TODO ] lint.per-file-ignores."tools/ports/*.py" = [ "unused-function-argument", "unused-lambda-argument" ] lint.per-file-ignores."tools/webidl_binder.py" = [ "printf-string-formatting", "f-string" ] lint.per-file-ignores."test/other/ports/*.py" = [ "unused-function-argument" ] lint.per-file-ignores."test/parallel_testsuite.py" = [ "unused-method-argument" ] lint.per-file-ignores."test/test_benchmark.py" = [ "unused-method-argument" ] -lint.per-file-ignores."test/*.py" = [ "collection-literal-concatenation", "printf-string-formatting" ] +lint.per-file-ignores."test/*.py" = [ "collection-literal-concatenation", "printf-string-formatting", "multiple-spaces-after-comma" ] +lint.per-file-ignores."system/lib/update_*.py" = [ "multiple-spaces-after-comma" ] lint.mccabe.max-complexity = 51 # Recommended: 10 lint.pylint.allow-magic-value-types = [ "bytes", diff --git a/test/test_other.py b/test/test_other.py index c8e595b889f7f..4b67adb1a2be8 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3,6 +3,7 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. +# ruff: file-ignore[multiple-spaces-before-keyword] import errno import glob diff --git a/tools/config.py b/tools/config.py index b9841f807d65b..252387f0e8e66 100644 --- a/tools/config.py +++ b/tools/config.py @@ -3,6 +3,8 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. +# ruff: file-ignore[missing-f-string-syntax] + import logging import os import shutil diff --git a/tools/empath-split.py b/tools/empath-split.py index 09e7286013596..cdcdab00cb16b 100755 --- a/tools/empath-split.py +++ b/tools/empath-split.py @@ -285,7 +285,7 @@ def parse_paths_file(paths_file_content): else: path = normalize_path(line) if path in path_to_module: - exit_with_error("Path '{path}' cannot be assigned to module '{cur_module}; it is already assigned to module '{path_to_module[path]}'") + exit_with_error(f"Path '{path}' cannot be assigned to module '{cur_module}; it is already assigned to module '{path_to_module[path]}'") cur_paths.append(path) path_to_module[path] = cur_module diff --git a/tools/maint/create_dom_pk_codes.py b/tools/maint/create_dom_pk_codes.py index 88fca5a62c11d..ef3860c9625c4 100755 --- a/tools/maint/create_dom_pk_codes.py +++ b/tools/maint/create_dom_pk_codes.py @@ -30,6 +30,8 @@ # Use #include in your code to access these IDs. +# ruff: file-ignore[multiple-spaces-after-comma] + import os import random import sys diff --git a/tools/settings.py b/tools/settings.py index 003f36d5e1dac..ef2b0f1b05bbb 100644 --- a/tools/settings.py +++ b/tools/settings.py @@ -133,7 +133,7 @@ ('WASM_WORKERS', 'MAIN_MODULE', 'dynamic linking is not supported with -sWASM_WORKERS'), ('WASM2JS', 'MAIN_MODULE', 'wasm2js does not support dynamic linking'), ('WASM2JS', 'SIDE_MODULE', 'wasm2js does not support dynamic linking'), - ('WASM2JS', 'GROWABLE_ARRAYBUFFERS', None), + ('WASM2JS', 'GROWABLE_ARRAYBUFFERS', None), ('WASM2JS', 'SUPPORT_BIG_ENDIAN', None), ('WASM2JS', 'MEMORY64', None), ('MAIN_MODULE', 'NO_WASM_ASYNC_COMPILATION', 'dynamic linking requires async wasm compilation'), diff --git a/tools/webidl_binder.py b/tools/webidl_binder.py index 56085c55a9ee5..900cc0c38e5c5 100644 --- a/tools/webidl_binder.py +++ b/tools/webidl_binder.py @@ -493,33 +493,33 @@ def is_ptr_arg(i): # Wrap asserts with existence check when argument is optional. if all_checks and optional: - body += "if(typeof {0} !== 'undefined' && {0} !== null) {{\n".format(js_arg) + body += f"if(typeof {js_arg} !== 'undefined' && {js_arg} !== null) {{\n" # Special case argument types. if arg.type.isNumeric(): if arg.type.isInteger(): if all_checks: - body += " assert(typeof {0} === 'number' && !isNaN({0}), '{1}Expecting ');\n".format(js_arg, check_msg) + body += f" assert(typeof {js_arg} === 'number' && !isNaN({js_arg}), '{check_msg}Expecting ');\n" else: if all_checks: - body += " assert(typeof {0} === 'number', '{1}Expecting ');\n".format(js_arg, check_msg) + body += f" assert(typeof {js_arg} === 'number', '{check_msg}Expecting ');\n" # No transform needed for numbers elif arg.type.isBoolean(): if all_checks: - body += " assert(typeof {0} === 'boolean' || (typeof {0} === 'number' && !isNaN({0})), '{1}Expecting ');\n".format(js_arg, check_msg) + body += f" assert(typeof {js_arg} === 'boolean' || (typeof {0} === 'number' && !isNaN({0})), '{1}Expecting ');\n" # No transform needed for booleans elif arg.type.isString(): # Strings can be DOM strings or pointers. if all_checks: - body += " assert(typeof {0} === 'string' || ({0} && typeof {0} === 'object' && typeof {0}.ptr === 'number'), '{1}Expecting ');\n".format(js_arg, check_msg) + body += f" assert(typeof {js_arg} === 'string' || ({js_arg} && typeof {js_arg} === 'object' && typeof {js_arg}.ptr === 'number'), '{check_msg}Expecting ');\n" do_default = True # legacy path is fast enough for strings. elif arg.type.isInterface(): if all_checks: - body += " assert(typeof {0} === 'object' && typeof {0}.ptr === 'number', '{1}Expecting ');\n".format(js_arg, check_msg) + body += f" assert(typeof {js_arg} === 'object' && typeof {js_arg}.ptr === 'number', '{check_msg}Expecting ');\n" if optional: - body += " if(typeof {0} !== 'undefined' && {0} !== null) {{ {0} = {0}.ptr }};\n".format(js_arg) + body += f" if(typeof {js_arg} !== 'undefined' && {js_arg} !== null) {{ {js_arg} = {js_arg}.ptr }};\n" else: # No checks in fast mode when the arg is required - body += " {0} = {0}.ptr;\n".format(js_arg) + body += f" {js_arg} = {js_arg}.ptr;\n" else: do_default = True