From 9f8a2dbc7fc29b3e52fb6eb1322bf28920f2a27d Mon Sep 17 00:00:00 2001 From: Kieran W <41634689+FredHappyface@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:58:31 +0100 Subject: [PATCH] Fix `UnicodeError` thrown in pre-commit --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 5 +++++ blackt/__init__.py | 2 +- pyproject.toml | 4 ++-- requirements.txt | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4853eed..3607b08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/FHPythonUtils/Blackt - rev: '2022.0.1' + rev: '2022.0.2' hooks: - id: blackt diff --git a/CHANGELOG.md b/CHANGELOG.md index f31e8f2..18c64da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](../../commits/master). +## 2022.0.2 - 2022/04/06 + +- Fix `UnicodeError` thrown in pre-commit +- Update black to fix https://github.com/psf/black/issues/2964 + ## 2022.0.1 - 2022/01/28 - Fix `UnicodeEncodeError` thrown in pre-commit diff --git a/blackt/__init__.py b/blackt/__init__.py index 1387d18..5d3d6c1 100644 --- a/blackt/__init__.py +++ b/blackt/__init__.py @@ -42,7 +42,7 @@ def main(): try: print(out.encode("utf-8").decode("unicode_escape")) # pylint: disable=no-member - except UnicodeEncodeError: # thrown in pre-commit + except UnicodeError: # thrown in pre-commit print(out) sys.exit(exitCode) diff --git a/pyproject.toml b/pyproject.toml index a273910..2b0ac9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "blackt" license = "mit" -version = "2022.0.1" +version = "2022.0.2" description = "Black but with tabs" authors = ["FredHappyface"] classifiers = [ @@ -21,7 +21,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.6.2" -black = "<22,>=21.12b0" +black = "<23,>=22.3.0" [tool.poetry.scripts] blackt = 'blackt:main' diff --git a/requirements.txt b/requirements.txt index 5bcb17f..22076a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -black<22,>=21.12b0 +black<23,>=22.3.0