diff options
author | generatedunixname89002005325672 <generatedunixname89002005325672@fb.com> | 2022-12-12 07:51:03 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2022-12-12 07:51:03 -0800 |
commit | 434aa8ebe67658214dcae0235adf7b29bfe13da4 (patch) | |
tree | 62aad073271bb6a40f6dc30d4f0a596bc32703b0 | |
parent | de3d7a3229d01da00db255d8e2fa56b67c753b40 (diff) | |
download | ktfmt-434aa8ebe67658214dcae0235adf7b29bfe13da4.tar.gz |
Daily `arc lint --take KTFMT`
Reviewed By: adamjernst
Differential Revision: D41833756
fbshipit-source-id: 0ecc95aff3bdadadb0769dec55d27fb84fe50e95
4 files changed, 16 insertions, 18 deletions
diff --git a/core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt b/core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt index 898b70e..dd17d56 100644 --- a/core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt +++ b/core/src/main/java/com/facebook/ktfmt/format/KotlinInputAstVisitor.kt @@ -277,7 +277,7 @@ class KotlinInputAstVisitor( /** * @param keyword e.g., "fun" or "class". * @param typeOrDelegationCall for functions, the return typeOrDelegationCall; for classes, the - * list of supertypes. + * list of supertypes. */ private fun visitFunctionLikeExpression( modifierList: KtModifierList?, @@ -627,6 +627,7 @@ class KotlinInputAstVisitor( * lastIndexToOpen to track the spot after the last time we stopped * grouping. * ``` + * * The final expression with groupings: * ``` * {{a.b}[2]}.{c.d}() @@ -794,7 +795,7 @@ class KotlinInputAstVisitor( * Example (`1, "hi"`) in a function call * * @return a [BreakTag] which can tell you if a break was taken, but only when the list doesn't - * terminate in a negative closing indent. See [visitEachCommaSeparated] for examples. + * terminate in a negative closing indent. See [visitEachCommaSeparated] for examples. */ private fun visitValueArgumentListInternal(list: KtValueArgumentList): BreakTag? { builder.sync(list) @@ -844,9 +845,9 @@ class KotlinInputAstVisitor( * The internal version of [visitLambdaExpression]. * * @param brokeBeforeBrace used for tracking if a break was taken right before the lambda - * expression. Useful for scoping functions where we want good looking indentation. For example, - * here we have correct indentation before `bar()` and `car()` because we can detect the break - * after the equals: + * expression. Useful for scoping functions where we want good looking indentation. For example, + * here we have correct indentation before `bar()` and `car()` because we can detect the break + * after the equals: * ``` * fun foo() = * coroutineScope { x -> @@ -993,7 +994,7 @@ class KotlinInputAstVisitor( * ``` * * @param hasTrailingComma if true, each element is placed on its own line (even if they could've - * fit in a single line), and a trailing comma is emitted. + * fit in a single line), and a trailing comma is emitted. * * Example: * ``` @@ -1002,17 +1003,17 @@ class KotlinInputAstVisitor( * ``` * * @param wrapInBlock if true, place all the elements in a block. When there's no [leadingBreak], - * this will be negatively indented. Note that the [prefix] and [postfix] aren't included in the - * block. + * this will be negatively indented. Note that the [prefix] and [postfix] aren't included in the + * block. * @param leadingBreak if true, break before the first element. * @param prefix if provided, emit this before the first element. * @param postfix if provided, emit this after the last element (or trailing comma). * @param breakAfterPrefix if true, emit a break after [prefix], but before the start of the - * block. + * block. * @param breakBeforePostfix if true, place a break after the last element. Redundant when - * [hasTrailingComma] is true. + * [hasTrailingComma] is true. * @return a [BreakTag] which can tell you if a break was taken, but only when the list doesn't - * terminate in a negative closing indent. + * terminate in a negative closing indent. * * Example 1, this returns a BreakTag which tells you a break wasn't taken: * ``` diff --git a/core/src/main/java/com/facebook/ktfmt/format/TypeNameClassifier.kt b/core/src/main/java/com/facebook/ktfmt/format/TypeNameClassifier.kt index eba3ccc..76fac3e 100644 --- a/core/src/main/java/com/facebook/ktfmt/format/TypeNameClassifier.kt +++ b/core/src/main/java/com/facebook/ktfmt/format/TypeNameClassifier.kt @@ -90,7 +90,6 @@ object TypeNameClassifier { * a type or static field access, or -1 if no such prefix was found. * * Examples: - * * * ClassName * * ClassName.staticMemberName * * com.google.ClassName.InnerClass.staticMemberName diff --git a/core/src/main/java/com/facebook/ktfmt/kdoc/Escaping.kt b/core/src/main/java/com/facebook/ktfmt/kdoc/Escaping.kt index 85c9938..d3d3c10 100644 --- a/core/src/main/java/com/facebook/ktfmt/kdoc/Escaping.kt +++ b/core/src/main/java/com/facebook/ktfmt/kdoc/Escaping.kt @@ -44,10 +44,7 @@ object Escaping { s.substring(endMarkerIndex) } - /** - * - * See [escapeKDoc]. - */ + /** See [escapeKDoc]. */ fun unescapeKDoc(s: String): String = s.replace(SLASH_STAR_ESCAPE, "/*").replace(STAR_SLASH_ESCAPE, "*/") } diff --git a/core/src/test/java/com/facebook/ktfmt/testutil/KtfmtTruth.kt b/core/src/test/java/com/facebook/ktfmt/testutil/KtfmtTruth.kt index 3a2a620..de67121 100644 --- a/core/src/test/java/com/facebook/ktfmt/testutil/KtfmtTruth.kt +++ b/core/src/test/java/com/facebook/ktfmt/testutil/KtfmtTruth.kt @@ -29,14 +29,15 @@ import org.junit.Assert * Verifies the given code passes through formatting, and stays the same at the end * * @param code a code string that continas an optional first line made of "---" in the case - * [deduceMaxWidth] is true. For example: + * [deduceMaxWidth] is true. For example: * ``` * -------------------- * // exactly 20 `-` above * fun f() * ``` + * * @param deduceMaxWidth if this is true the code string should start with a line of "-----" in the - * beginning to indicate the max width to format by + * beginning to indicate the max width to format by */ fun assertFormatted( code: String, |