From 39bf15b5bc14674c8809182a321d2ed6d9596b0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 22:03:28 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.272 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.272...v0.0.281) - [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 954ac44..08bf229 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,8 @@ repos: rev: 5.12.0 hooks: - id: isort -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.272 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.281 hooks: - id: ruff args: @@ -38,6 +38,6 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black From cfe9ddf5292e09e506a4e39a258effd8455f507d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 1 Aug 2023 13:00:15 +0200 Subject: [PATCH 2/2] fix B034 --- matrix_webhook/formatters.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/matrix_webhook/formatters.py b/matrix_webhook/formatters.py index 8ca321b..085e1dc 100644 --- a/matrix_webhook/formatters.py +++ b/matrix_webhook/formatters.py @@ -49,7 +49,12 @@ def github(data, headers): def gitlab_gchat(data, headers): """Pretty-print a gitlab notification preformatted for Google Chat.""" - data["body"] = re.sub("<(.*?)\\|(.*?)>", "[\\2](\\1)", data["body"], re.MULTILINE) + data["body"] = re.sub( + "<(.*?)\\|(.*?)>", + "[\\2](\\1)", + data["body"], + flags=re.MULTILINE, + ) return data