Skip to content

Commit 2e9b09c

Browse files
authored
Fix the Black regex for old versions (regression when we fixed for new versions) (#1197)
2 parents 4230476 + 408dc68 commit 2e9b09c

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Fixed
14+
* 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`)
1315

1416
## [2.25.2] - 2022-05-03
1517
### Changes

lib/src/main/java/com/diffplug/spotless/python/BlackStep.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private State createState() throws IOException, InterruptedException {
6464
String trackingIssue = "\n github issue to handle this better: https://github.com/diffplug/spotless/issues/674";
6565
String exeAbsPath = ForeignExe.nameAndVersion("black", version)
6666
.pathToExe(pathToExe)
67-
.versionRegex(Pattern.compile("(?:black,|version) (\\S*)"))
67+
.versionRegex(Pattern.compile("(?:black, version|black,|version) (\\S*)"))
6868
.fixCantFind("Try running {@code pip install black=={version}}, or else tell Spotless where it is with {@code black().pathToExe('path/to/executable')}" + trackingIssue)
6969
.fixWrongVersion("Try running {@code pip install --force-reinstall black=={version}}, or else specify {@code black('{versionFound}')} to Spotless" + trackingIssue)
7070
.confirmVersionAndGetAbsolutePath();

plugin-gradle/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* 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`)
68

79
## [6.5.2] - 2022-05-03
810
### Changes

plugin-maven/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* 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`)
68

79
## [2.22.4] - 2022-05-03
810
### Changes

0 commit comments

Comments
 (0)