]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Show details when a regex fails to compile (GH-2678)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Wed, 8 Dec 2021 03:13:05 +0000 (19:13 -0800)
committerGitHub <noreply@github.com>
Wed, 8 Dec 2021 03:13:05 +0000 (22:13 -0500)
CHANGES.md
src/black/__init__.py

index 9e13ef438cbecb9b6ae607727553207c66d2590c..3724820275031dc25052108b50a1935f3c9dae73 100644 (file)
@@ -1,5 +1,11 @@
 # Change Log
 
 # Change Log
 
+## Unreleased
+
+### _Black_
+
+- Improve error message for invalid regular expression (#2678)
+
 ## 21.12b0
 
 ### _Black_
 ## 21.12b0
 
 ### _Black_
index 1923c069edec794956a3c5a4506ce1ca7a4cea03..e2376c45617469d7890c0036c15fc4ac7139c27b 100644 (file)
@@ -177,8 +177,8 @@ def validate_regex(
 ) -> Optional[Pattern[str]]:
     try:
         return re_compile_maybe_verbose(value) if value is not None else None
 ) -> Optional[Pattern[str]]:
     try:
         return re_compile_maybe_verbose(value) if value is not None else None
-    except re.error:
-        raise click.BadParameter("Not a valid regular expression") from None
+    except re.error as e:
+        raise click.BadParameter(f"Not a valid regular expression: {e}") from None
 
 
 @click.command(
 
 
 @click.command(