Skip to content

Commit 82353fd

Browse files
committed
spotlessApply
1 parent 2338473 commit 82353fd

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lib/src/main/java/com/diffplug/spotless/cpp/ClangFormatStep.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 DiffPlug
2+
* Copyright 2020-2022 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -69,19 +69,19 @@ public FormatterStep create() {
6969

7070
private State createState() throws IOException, InterruptedException {
7171
String howToInstall = "" +
72-
"You can download clang-format from https://releases.llvm.org and " +
73-
"then point Spotless to it with {@code pathToExe('/path/to/clang-format')} " +
74-
"or you can use your platform's package manager:" +
75-
"\n win: choco install llvm --version {version} (try dropping version if it fails)" +
76-
"\n mac: brew install clang-format (TODO: how to specify version?)" +
77-
"\n linux: apt install clang-format (try clang-format-{version} with dropped minor versions)" +
78-
"\n github issue to handle this better: https://github.com/diffplug/spotless/issues/673";
79-
final ForeignExe exe = ForeignExe.nameAndVersion("clang-format", version)
80-
.pathToExe(pathToExe)
81-
.fixCantFind(howToInstall)
82-
.fixWrongVersion(
83-
"You can tell Spotless to use the version you already have with {@code clangFormat('{versionFound}')}" +
84-
"or you can download the currently specified version, {version}.\n" + howToInstall);
72+
"You can download clang-format from https://releases.llvm.org and " +
73+
"then point Spotless to it with {@code pathToExe('/path/to/clang-format')} " +
74+
"or you can use your platform's package manager:" +
75+
"\n win: choco install llvm --version {version} (try dropping version if it fails)" +
76+
"\n mac: brew install clang-format (TODO: how to specify version?)" +
77+
"\n linux: apt install clang-format (try clang-format-{version} with dropped minor versions)" +
78+
"\n github issue to handle this better: https://github.com/diffplug/spotless/issues/673";
79+
final ForeignExe exe = ForeignExe.nameAndVersion("clang-format", version)
80+
.pathToExe(pathToExe)
81+
.fixCantFind(howToInstall)
82+
.fixWrongVersion(
83+
"You can tell Spotless to use the version you already have with {@code clangFormat('{versionFound}')}" +
84+
"or you can download the currently specified version, {version}.\n" + howToInstall);
8585
return new State(this, exe);
8686
}
8787

@@ -106,7 +106,7 @@ String format(ProcessRunner runner, String input, File file) throws IOException,
106106
final List<String> tmpArgs = new ArrayList<>();
107107
tmpArgs.add(exe.confirmVersionAndGetAbsolutePath());
108108
if (style != null) {
109-
tmpArgs.add("--style="+ style);
109+
tmpArgs.add("--style=" + style);
110110
}
111111
args = tmpArgs;
112112
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static class State implements Serializable {
8585

8686
String format(ProcessRunner runner, String input) throws IOException, InterruptedException {
8787
if (args == null) {
88-
args = new String[] {exe.confirmVersionAndGetAbsolutePath(), "-"};
88+
args = new String[]{exe.confirmVersionAndGetAbsolutePath(), "-"};
8989
}
9090
return runner.exec(input.getBytes(StandardCharsets.UTF_8), args).assertExitZero(StandardCharsets.UTF_8);
9191
}

0 commit comments

Comments
 (0)