diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 363dbc4..e840869 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,28 +27,28 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v4.0.0-alpha.8" + - repo: https://github.com/rbubley/mirrors-prettier + rev: "v3.3.3" hooks: - id: prettier types_or: [yaml, markdown, html, css, scss, javascript, json] args: [--prose-wrap=always] - repo: https://github.com/adamchainz/blacken-docs - rev: 1.16.0 + rev: 1.18.0 hooks: - id: blacken-docs additional_dependencies: [black==23.*] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.5" + rev: "v0.6.5" hooks: - id: ruff args: ["--fix", "--show-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.11.2 hooks: - id: mypy files: src diff --git a/pyproject.toml b/pyproject.toml index efb1319..c89784e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,15 +73,12 @@ files = "src" python_version = "3.10" warn_unused_configs = true strict = true -show_error_codes = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] warn_unreachable = true -[tool.ruff] -src = ["src"] [tool.ruff.lint] -select = [ +extend-select = [ "B", # flake8-bugbear "I", # isort "ARG", # flake8-unused-arguments diff --git a/src/flake8_errmsg/__init__.py b/src/flake8_errmsg/__init__.py index 969592d..aa3696e 100644 --- a/src/flake8_errmsg/__init__.py +++ b/src/flake8_errmsg/__init__.py @@ -65,27 +65,27 @@ def visit_Raise(self, node: ast.Raise) -> None: pass -def EM101(node: ast.AST) -> Flake8ASTErrorInfo: +def EM101(node: ast.stmt) -> Flake8ASTErrorInfo: msg = "EM101 Exception must not use a string literal, assign to variable first" return Flake8ASTErrorInfo(node.lineno, node.col_offset, msg, Visitor) -def EM102(node: ast.AST) -> Flake8ASTErrorInfo: +def EM102(node: ast.stmt) -> Flake8ASTErrorInfo: msg = "EM102 Exception must not use an f-string literal, assign to variable first" return Flake8ASTErrorInfo(node.lineno, node.col_offset, msg, Visitor) -def EM103(node: ast.AST) -> Flake8ASTErrorInfo: +def EM103(node: ast.stmt) -> Flake8ASTErrorInfo: msg = "EM103 Exception must not use a .format() string directly, assign to variable first" return Flake8ASTErrorInfo(node.lineno, node.col_offset, msg, Visitor) -def EM104(node: ast.AST) -> Flake8ASTErrorInfo: +def EM104(node: ast.stmt) -> Flake8ASTErrorInfo: msg = "EM104 Built-in Exceptions must not be thrown without being called" return Flake8ASTErrorInfo(node.lineno, node.col_offset, msg, Visitor) -def EM105(node: ast.AST) -> Flake8ASTErrorInfo: +def EM105(node: ast.stmt) -> Flake8ASTErrorInfo: msg = "EM105 Built-in Exceptions must have a useful message" return Flake8ASTErrorInfo(node.lineno, node.col_offset, msg, Visitor)