mirror of
https://github.com/apple/pkl.git
synced 2026-04-11 03:06:55 +02:00
Run spotless formatting (#958)
When we updated spotless's Java and Kotlin formatter, we changed the underlying formatting rules. However, due to spotless ratcheting, these formatting changes don't get applied unless a file gets touched in a commit. To avoid future PRs introducing lines of change that aren't related to the intention of the PR, this is a one-time format of all files.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -118,14 +118,14 @@ public final class CodeGeneratorUtils {
|
||||
*/
|
||||
private static boolean isValidIdentifierPart(int codePoint, int category) {
|
||||
return switch (category) {
|
||||
// NOT Character.CURRENCY_SYMBOL, which is valid in Java, but invalid in Kotlin
|
||||
// NOT Character.CURRENCY_SYMBOL, which is valid in Java, but invalid in Kotlin
|
||||
case Character.LOWERCASE_LETTER,
|
||||
Character.UPPERCASE_LETTER,
|
||||
Character.MODIFIER_LETTER,
|
||||
Character.OTHER_LETTER,
|
||||
Character.TITLECASE_LETTER,
|
||||
Character.LETTER_NUMBER,
|
||||
Character.DECIMAL_DIGIT_NUMBER ->
|
||||
Character.UPPERCASE_LETTER,
|
||||
Character.MODIFIER_LETTER,
|
||||
Character.OTHER_LETTER,
|
||||
Character.TITLECASE_LETTER,
|
||||
Character.LETTER_NUMBER,
|
||||
Character.DECIMAL_DIGIT_NUMBER ->
|
||||
true;
|
||||
default -> codePoint == UNDERSCORE;
|
||||
};
|
||||
@@ -133,18 +133,18 @@ public final class CodeGeneratorUtils {
|
||||
|
||||
private static boolean isPunctuationOrSpacing(int category) {
|
||||
return switch (category) {
|
||||
// Punctuation
|
||||
// Punctuation
|
||||
case Character.CONNECTOR_PUNCTUATION, // Pc
|
||||
Character.DASH_PUNCTUATION, // Pd
|
||||
Character.START_PUNCTUATION, // Ps
|
||||
Character.END_PUNCTUATION, // Pe
|
||||
Character.INITIAL_QUOTE_PUNCTUATION, // Pi
|
||||
Character.FINAL_QUOTE_PUNCTUATION, // Pf
|
||||
Character.OTHER_PUNCTUATION, // Po
|
||||
// Spacing
|
||||
Character.SPACE_SEPARATOR, // Zs
|
||||
Character.LINE_SEPARATOR, // Zl
|
||||
Character.PARAGRAPH_SEPARATOR -> // Zp
|
||||
Character.DASH_PUNCTUATION, // Pd
|
||||
Character.START_PUNCTUATION, // Ps
|
||||
Character.END_PUNCTUATION, // Pe
|
||||
Character.INITIAL_QUOTE_PUNCTUATION, // Pi
|
||||
Character.FINAL_QUOTE_PUNCTUATION, // Pf
|
||||
Character.OTHER_PUNCTUATION, // Po
|
||||
// Spacing
|
||||
Character.SPACE_SEPARATOR, // Zs
|
||||
Character.LINE_SEPARATOR, // Zl
|
||||
Character.PARAGRAPH_SEPARATOR -> // Zp
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -227,7 +227,7 @@ public final class GlobResolver {
|
||||
sb.append("!");
|
||||
}
|
||||
|
||||
// no special meaning in glob patterns but have special meaning in regex.
|
||||
// no special meaning in glob patterns but have special meaning in regex.
|
||||
case '.', '(', '%', '^', '$', '|' -> sb.append("\\").append(current);
|
||||
default -> sb.append(current);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -611,27 +611,27 @@ public final class IoUtils {
|
||||
public static boolean isHexDigit(char ch) {
|
||||
return switch (ch) {
|
||||
case '0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f' ->
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f' ->
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
@@ -640,28 +640,28 @@ public final class IoUtils {
|
||||
public static boolean isHexDigitOrUnderscore(char ch) {
|
||||
return switch (ch) {
|
||||
case '0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
'_' ->
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
'_' ->
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
@@ -751,46 +751,46 @@ public final class IoUtils {
|
||||
public static boolean isReservedWindowsFilenameChar(char character) {
|
||||
return switch (character) {
|
||||
case 0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
'<',
|
||||
'>',
|
||||
':',
|
||||
'"',
|
||||
'\\',
|
||||
'/',
|
||||
'|',
|
||||
'?',
|
||||
'*' ->
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
'<',
|
||||
'>',
|
||||
':',
|
||||
'"',
|
||||
'\\',
|
||||
'/',
|
||||
'|',
|
||||
'?',
|
||||
'*' ->
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -563,7 +563,7 @@ public final class JsonWriter implements Closeable, Flushable {
|
||||
if (!lenient) {
|
||||
throw new IllegalStateException("JSON must have only one top-level value.");
|
||||
}
|
||||
// fall-through
|
||||
// fall-through
|
||||
case EMPTY_DOCUMENT: // first in document
|
||||
replaceTop(NONEMPTY_DOCUMENT);
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,28 +29,28 @@ public final class Yaml12Emitter extends YamlEmitter {
|
||||
|
||||
return switch (str) {
|
||||
case "",
|
||||
"~",
|
||||
"null",
|
||||
"Null",
|
||||
"NULL",
|
||||
".nan",
|
||||
".NaN",
|
||||
".NAN",
|
||||
".inf",
|
||||
".Inf",
|
||||
".INF",
|
||||
"+.inf",
|
||||
"+.Inf",
|
||||
"+.INF",
|
||||
"-.inf",
|
||||
"-.Inf",
|
||||
"-.INF",
|
||||
"true",
|
||||
"True",
|
||||
"TRUE",
|
||||
"false",
|
||||
"False",
|
||||
"FALSE" ->
|
||||
"~",
|
||||
"null",
|
||||
"Null",
|
||||
"NULL",
|
||||
".nan",
|
||||
".NaN",
|
||||
".NAN",
|
||||
".inf",
|
||||
".Inf",
|
||||
".INF",
|
||||
"+.inf",
|
||||
"+.Inf",
|
||||
"+.INF",
|
||||
"-.inf",
|
||||
"-.Inf",
|
||||
"-.INF",
|
||||
"true",
|
||||
"True",
|
||||
"TRUE",
|
||||
"false",
|
||||
"False",
|
||||
"FALSE" ->
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -137,7 +137,7 @@ public abstract class YamlEmitter {
|
||||
needsQuoting =
|
||||
needsQuoting || i == (length - 1) || (i + 1 < length) && str.charAt(i + 1) == ' ';
|
||||
}
|
||||
// number chars
|
||||
// number chars
|
||||
case '0',
|
||||
'1',
|
||||
'2',
|
||||
@@ -228,44 +228,44 @@ public abstract class YamlEmitter {
|
||||
|
||||
return switch (str) {
|
||||
case "",
|
||||
"~",
|
||||
"null",
|
||||
"Null",
|
||||
"NULL",
|
||||
".nan",
|
||||
".NaN",
|
||||
".NAN",
|
||||
".inf",
|
||||
".Inf",
|
||||
".INF",
|
||||
"+.inf",
|
||||
"+.Inf",
|
||||
"+.INF",
|
||||
"-.inf",
|
||||
"-.Inf",
|
||||
"-.INF",
|
||||
"true",
|
||||
"True",
|
||||
"TRUE",
|
||||
"false",
|
||||
"False",
|
||||
"FALSE",
|
||||
"on",
|
||||
"On",
|
||||
"ON",
|
||||
"off",
|
||||
"Off",
|
||||
"OFF",
|
||||
"y",
|
||||
"Y",
|
||||
"yes",
|
||||
"Yes",
|
||||
"YES",
|
||||
"n",
|
||||
"N",
|
||||
"no",
|
||||
"No",
|
||||
"NO" ->
|
||||
"~",
|
||||
"null",
|
||||
"Null",
|
||||
"NULL",
|
||||
".nan",
|
||||
".NaN",
|
||||
".NAN",
|
||||
".inf",
|
||||
".Inf",
|
||||
".INF",
|
||||
"+.inf",
|
||||
"+.Inf",
|
||||
"+.INF",
|
||||
"-.inf",
|
||||
"-.Inf",
|
||||
"-.INF",
|
||||
"true",
|
||||
"True",
|
||||
"TRUE",
|
||||
"false",
|
||||
"False",
|
||||
"FALSE",
|
||||
"on",
|
||||
"On",
|
||||
"ON",
|
||||
"off",
|
||||
"Off",
|
||||
"OFF",
|
||||
"y",
|
||||
"Y",
|
||||
"yes",
|
||||
"Yes",
|
||||
"YES",
|
||||
"n",
|
||||
"N",
|
||||
"no",
|
||||
"No",
|
||||
"NO" ->
|
||||
true;
|
||||
default -> false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user