Skip to content

Commit

Permalink
chore: update pre-commit hooks (#41)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/adamchainz/blacken-docs: 1.16.0 →
1.18.0](adamchainz/blacken-docs@1.16.0...1.18.0)
- [github.com/astral-sh/ruff-pre-commit: v0.4.5 →
v0.6.5](astral-sh/ruff-pre-commit@v0.4.5...v0.6.5)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 →
v1.11.2](pre-commit/mirrors-mypy@v1.10.0...v1.11.2)
<!--pre-commit.ci end-->

---------

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and henryiii committed Sep 17, 2024
1 parent d6b739f commit 620d4dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/flake8_errmsg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 620d4dd

Please sign in to comment.