Update pre-commit and fix new issues (#4975)

This commit is contained in:
M Bussonnier 2024-08-01 01:52:39 -07:00 committed by GitHub
parent 1441f554d9
commit 135d83e50a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 17 additions and 11 deletions

View File

@ -17,14 +17,14 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.5"
rev: "v0.5.0"
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v18.1.3"
rev: "v18.1.8"
hooks:
- id: clang-format
types_or: [c++, c, cuda]
@ -45,9 +45,15 @@ repos:
exclude: ^src/templates/python$
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
args:
[
"--ignore-words-list",
"ags,aray,asend,ba,crate,falsy,feld,inflight,lits,nd,slowy,te,oint,conveniant,atmost",
]
exclude: ^(benchmark/benchmarks/pystone_benchmarks/pystone\.py|src/js/package-lock\.json)$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.11.0"

View File

@ -97,7 +97,7 @@ def test_import(
def _import_pkg():
for import_name in import_names:
selenium_standalone.run_async("import %s" % import_name)
selenium_standalone.run_async(f"import {import_name}")
benchmark(_import_pkg)

View File

@ -5,9 +5,10 @@ from pytest_pyodide import run_in_pyodide
def test_lzma(selenium):
# TODO: libregrtest.main(["test_lzma"]) doesn't collect any tests for some unknown reason.
import test.test_lzma
import unittest
import test.test_lzma
suite = unittest.TestSuite(
[unittest.TestLoader().loadTestsFromModule(test.test_lzma)]
)

View File

@ -3,9 +3,10 @@ from pytest_pyodide import run_in_pyodide
@run_in_pyodide(packages=["test", "sqlite3"], pytest_assert_rewrites=False)
def test_sqlite3(selenium):
import test.test_sqlite3
import unittest
import test.test_sqlite3
suite = unittest.TestSuite(
[unittest.TestLoader().loadTestsFromModule(test.test_sqlite3)]
)

View File

@ -6,6 +6,7 @@ def test_ssl(selenium):
import platform
import unittest
import unittest.mock
from test.libregrtest.main import main
platform.platform(aliased=True)

View File

@ -62,7 +62,7 @@ lint.select = [
"PLE", # pylint errors
"UP", # pyupgrade
]
lint.ignore = ["E402", "E501", "E731", "E741", "UP038"]
lint.ignore = ["E402", "E501", "E731", "E741", "UP031", "UP038"]
# line-length = 219 # E501: Recommended goal is 88 to match black
target-version = "py311"

View File

@ -18,10 +18,7 @@ typedef struct Js_Identifier
JsRef object;
} Js_Identifier;
#define Js_static_string_init(value) \
{ \
.string = value, .object = NULL \
}
#define Js_static_string_init(value) { .string = value, .object = NULL }
#define Js_static_string(varname, value) \
static Js_Identifier varname = Js_static_string_init(value)
#define Js_IDENTIFIER(varname) Js_static_string(JsId_##varname, #varname)