Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #41

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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