Skip to content

Commit 01dc110

Browse files
authored
Tweak formatting config for exception lists (#54710)
Change how we format exceptions to only wrap them as necessary. While the config's overall philosophy is to put items one-per-line when wrapping, in practice this is a little cumbersome for exception lists.
1 parent 2c5951a commit 01dc110

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

buildSrc/formatterConfig.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
4848
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
4949
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
50-
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="80"/>
50+
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
5151
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
5252
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
5353
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
@@ -132,7 +132,7 @@
132132
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="48"/>
133133
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
134134
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="48"/>
135-
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="64"/>
135+
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
136136
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
137137
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
138138
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>

buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ private void failIfAnyMissing(String item, Boolean exists, String type) {
210210
}
211211

212212
private void checkDependencies(Map<String, Boolean> licenses, Map<String, Boolean> notices, Set<File> shaFiles)
213-
throws NoSuchAlgorithmException,
214-
IOException {
213+
throws NoSuchAlgorithmException, IOException {
215214
for (File dependency : dependencies) {
216215
String jarName = dependency.getName();
217216
String depName = regex.matcher(jarName).replaceFirst("");

distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ public static void main(final String[] args) throws InterruptedException, IOExce
124124
}
125125

126126
private List<String> jvmOptions(final Path config, final String esJavaOpts, final Map<String, String> substitutions)
127-
throws InterruptedException,
128-
IOException,
129-
JvmOptionsFileParserException {
127+
throws InterruptedException, IOException, JvmOptionsFileParserException {
130128

131129
final List<String> jvmOptions = readJvmOptionsFiles(config);
132130

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ private String getElasticUrl(
330330
final boolean isSnapshot,
331331
final String pluginId,
332332
final String platform
333-
) throws IOException,
334-
UserException {
333+
) throws IOException, UserException {
335334
final String baseUrl;
336335
if (isSnapshot && stagingHash == null) {
337336
throw new UserException(
@@ -506,9 +505,7 @@ private Path downloadAndValidate(
506505
final Path tmpDir,
507506
final boolean officialPlugin,
508507
boolean isBatch
509-
) throws IOException,
510-
PGPException,
511-
UserException {
508+
) throws IOException, PGPException, UserException {
512509
Path zip = downloadZip(terminal, urlString, tmpDir, isBatch);
513510
pathsToDeleteOnShutdown.add(zip);
514511
String checksumUrlString = urlString + ".sha512";

0 commit comments

Comments
 (0)