From 408dc68d10609fd8db194001279a34b2fc3876ac Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Fri, 6 May 2022 10:27:08 -0700 Subject: [PATCH] Fix the Black regex. --- CHANGES.md | 2 ++ lib/src/main/java/com/diffplug/spotless/python/BlackStep.java | 2 +- plugin-gradle/CHANGES.md | 2 ++ plugin-maven/CHANGES.md | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a30549e380..e7427e178d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,8 @@ This document is intended for Spotless developers. We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Fixed +* Update the `black` version regex to fix `19.10b0` and earlier. (fixes [#1195](https://github.com/diffplug/spotless/issues/1195), regression introduced in `2.25.0`) ## [2.25.2] - 2022-05-03 ### Changes diff --git a/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java b/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java index 3f4a8837b6..6a03d0d808 100644 --- a/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java +++ b/lib/src/main/java/com/diffplug/spotless/python/BlackStep.java @@ -64,7 +64,7 @@ private State createState() throws IOException, InterruptedException { String trackingIssue = "\n github issue to handle this better: https://github.com/diffplug/spotless/issues/674"; String exeAbsPath = ForeignExe.nameAndVersion("black", version) .pathToExe(pathToExe) - .versionRegex(Pattern.compile("(?:black,|version) (\\S*)")) + .versionRegex(Pattern.compile("(?:black, version|black,|version) (\\S*)")) .fixCantFind("Try running {@code pip install black=={version}}, or else tell Spotless where it is with {@code black().pathToExe('path/to/executable')}" + trackingIssue) .fixWrongVersion("Try running {@code pip install --force-reinstall black=={version}}, or else specify {@code black('{versionFound}')} to Spotless" + trackingIssue) .confirmVersionAndGetAbsolutePath(); diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 9397d1fa5a..963d6d06d7 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`). ## [Unreleased] +### Fixed +* Update the `black` version regex to fix `19.10b0` and earlier. (fixes [#1195](https://github.com/diffplug/spotless/issues/1195), regression introduced in `6.5.0`) ## [6.5.2] - 2022-05-03 ### Changes diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index fbacbc6c96..08cad5cfa9 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -3,6 +3,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`). ## [Unreleased] +### Fixed +* Update the `black` version regex to fix `19.10b0` and earlier. (fixes [#1195](https://github.com/diffplug/spotless/issues/1195), regression introduced in `2.22.2`) ## [2.22.4] - 2022-05-03 ### Changes