diff --git a/CHANGELOG.md b/CHANGELOG.md index 80dd82c5f1..f6fd5be7e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ None * Allow string template to exceed max line length when it is the only element on a line - [#2480](https://github.com/pinterest/ktlint/pull/2480), by @paul-dingemans -* Add configuration setting for ignoring `argument-list-wrapping` above treshold of argument - [#2481](https://github.com/pinterest/ktlint/pull/2481), by @paul-dingemans +* Add configuration setting for ignoring `argument-list-wrapping` above threshold of argument - [#2481](https://github.com/pinterest/ktlint/pull/2481), by @paul-dingemans NOTE: In code style `ktlint_official` this threshold is `unset` so that arguments are always wrapped. If this impacts your code too much, you can make it backward compatible by setting `.editorconfig` property `ktlint_argument_list_wrapping_ignore_when_parameter_count_greater_or_equal_than` to value `8`. For other code styles this property is initialized with value `8` and as of that backward compatible by default. * Ignore EOL comment that causes max_line_length to be exceeded, except in max-line-length rule - [#2516](https://github.com/pinterest/ktlint/pull/2516), by @paul-dingemans @@ -715,7 +715,7 @@ Module `ktlint-reporter-sarif` has been renamed to `ktlint-cli-reporter-sarif`. Custom rule sets build for older versions of KtLint are no longer supported by this version of KtLint. The `com.pinterest.ktlint.core.RuleSetProviderV2` interface has been replaced with `RuleSetProviderV3`. The accompanying interfaces `com.pinterest.ktlint.core.RuleProvider` and `com.pinterest.ktlint.core.Rule` have been replaced with `com.pinterest.ktlint.ruleset.core.api.RuleProvider` and `com.pinterest.ktlint.ruleset.core.api.Rule` respectively. -Contrary to `RuleSetProviderV2`, the `RuleSetProviderV3` no longer contains information about the rule set. About information now has to be specified in the new `Rule` class. This allows custom rule set providers to combine rules originating from different rule sets into a new rule set without loosing information about its origin. The type of the id of the rule set is changed from `String` to `RuleSetId`. +Contrary to `RuleSetProviderV2`, the `RuleSetProviderV3` no longer contains information about the rule set. About information now has to be specified in the new `Rule` class. This allows custom rule set providers to combine rules originating from different rule sets into a new rule set without losing information about its origin. The type of the id of the rule set is changed from `String` to `RuleSetId`. Note that due to renaming and relocation of the `RuleSetProviderV3` interface the name of the service provider in the custom reporter needs to be changed from `resources/META-INF/services/com.pinterest.ktlint.core.RuleSetProviderV2` to `resources/META-INF/services/com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3`. @@ -1097,7 +1097,7 @@ The Rule class now offers new life cycle hooks: Optionally, a rule can stop the traversal of the remainder of the AST whenever the goal of the rule has been achieved. See KDoc on Rule class for more information. -The "visit" life cycle hook will be removed in Ktlint 0.48. In KtLint 0.47 the "visit" life cycle hook will be called *only* when hook "beforeVisitChildNodes" is not overridden. It is recommended to migrate to the new lifecycle hooks in KtLint 0.47. Please create an issue, in case you need additional assistence to implement the new life cycle hooks in your rules. +The "visit" life cycle hook will be removed in Ktlint 0.48. In KtLint 0.47 the "visit" life cycle hook will be called *only* when hook "beforeVisitChildNodes" is not overridden. It is recommended to migrate to the new lifecycle hooks in KtLint 0.47. Please create an issue, in case you need additional assistance to implement the new life cycle hooks in your rules. #### Ruleset providing by Custom Rule Set Provider @@ -1380,7 +1380,7 @@ An AssertJ style API for testing KtLint rules ([#1444](https://github.com/pinter - Update Kotlin development version to `1.7.0` and Kotlin version to `1.7.0`. - Update shadow plugin to `7.1.2` release - Update picocli to `4.6.3` release -- A file containing only one (non private) top level declaration (class, interface, object, type alias or function) must be named after that declaration. The name also must comply with the Pascal Case convention. The same applies to a file containing one single top level class declaration and one ore more extension functions for that class. `filename` ([#1004](https://github.com/pinterest/ktlint/pull/1117)) +- A file containing only one (non private) top level declaration (class, interface, object, type alias or function) must be named after that declaration. The name also must comply with the Pascal Case convention. The same applies to a file containing one single top level class declaration and one or more extension functions for that class. `filename` ([#1004](https://github.com/pinterest/ktlint/pull/1117)) - Promote experimental rules to standard rules set: `annotation`, `annotation-spacing`, `argument-list-wrapping`, `double-colon-spacing`, `enum-entry-name-case`, `multiline-if-else`, `no-empty-first-line-in-method-block`, `package-name`, `traling-comma`, `spacing-around-angle-brackets`, `spacing-between-declarations-with-annotations`, `spacing-between-declarations-with-comments`, `unary-op-spacing` ([#1481](https://github.com/pinterest/ktlint/pull/1481)) - The CLI parameter `--android` can be omitted when the `.editorconfig` property `ktlint_code_style = android` is defined @@ -1612,12 +1612,12 @@ Special thanks to [t-kameyama](https://github.com/t-kameyama) for the huge numbe - Fix wrong indentation in named arguments (`indent`) ([#964](https://github.com/pinterest/ktlint/issues/964)) - Fix wrong indentation when a function has multiline type arguments (`parameter-list-wrapping`) ([#965](https://github.com/pinterest/ktlint/issues/965)) - Fix false positive for `spacing-between-declarations-with-annotations` ([#970](https://github.com/pinterest/ktlint/issues/970)) -- Fix ParseException when an assigment contains comments (`no-line-break-before-assignment`) ([#956](https://github.com/pinterest/ktlint/issues/956)) +- Fix ParseException when an assignment contains comments (`no-line-break-before-assignment`) ([#956](https://github.com/pinterest/ktlint/issues/956)) - Fix false positive when right brace is after a try-catch block (`spacing-around-keyword`) ([#978](https://github.com/pinterest/ktlint/issues/978)) - Fix false positive for control flow with empty body (`no-semicolons`) ([#955](https://github.com/pinterest/ktlint/issues/955)) - Fix incorrect indentation for multi-line call expressions in conditions (`indent`) ([#959](https://github.com/pinterest/ktlint/issues/959)) - Fix false positive for trailing comma before right parentheses|bracket|angle (`spacing-around-comma`) ([#975](https://github.com/pinterest/ktlint/issues/975)) -- Fix ktlint CLI could skip checking some of explicetly passed files ([#942](https://github.com/pinterest/ktlint/issues/942)) +- Fix ktlint CLI could skip checking some of explicitly passed files ([#942](https://github.com/pinterest/ktlint/issues/942)) ### Changed - 'import-ordering' now supports `.editorconfig' default value generation ([#701](https://github.com/pinterest/ktlint/issues/701)) diff --git a/documentation/release-latest/docs/rules/experimental.md b/documentation/release-latest/docs/rules/experimental.md index 0b1e105c5d..c3c661f887 100644 --- a/documentation/release-latest/docs/rules/experimental.md +++ b/documentation/release-latest/docs/rules/experimental.md @@ -486,7 +486,7 @@ Wraps each operand in a multiline condition to a separate line. baz1 || (baz2 && baz3) ) { - // do somthing + // do something } ``` @@ -500,7 +500,7 @@ Wraps each operand in a multiline condition to a separate line. if (bar1 || bar2 || baz1 || (baz2 && baz3) ) { - // do somthing + // do something } ``` diff --git a/documentation/snapshot/docs/rules/experimental.md b/documentation/snapshot/docs/rules/experimental.md index 0b1e105c5d..c3c661f887 100644 --- a/documentation/snapshot/docs/rules/experimental.md +++ b/documentation/snapshot/docs/rules/experimental.md @@ -486,7 +486,7 @@ Wraps each operand in a multiline condition to a separate line. baz1 || (baz2 && baz3) ) { - // do somthing + // do something } ``` @@ -500,7 +500,7 @@ Wraps each operand in a multiline condition to a separate line. if (bar1 || bar2 || baz1 || (baz2 && baz3) ) { - // do somthing + // do something } ``` diff --git a/gradle.properties b/gradle.properties index d1b043ab10..14e1ab0b9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ POM_LICENSE_DIST=repo POM_DEVELOPER_ID=pinterest POM_DEVELOPER_NAME=Pinterest, Inc. -# Default Gradle properties, can be overriden by other locations https://docs.gradle.org/8.2.1/userguide/build_environment.html#sec:gradle_configuration_properties +# Default Gradle properties, can be overridden by other locations https://docs.gradle.org/8.2.1/userguide/build_environment.html#sec:gradle_configuration_properties org.gradle.jvmargs=-Xmx4g org.gradle.parallel=true org.gradle.caching=true diff --git a/ktlint-cli-reporter-core/src/main/kotlin/com/pinterest/ktlint/cli/reporter/core/api/ReporterV2.kt b/ktlint-cli-reporter-core/src/main/kotlin/com/pinterest/ktlint/cli/reporter/core/api/ReporterV2.kt index 0353d0bd95..516384b228 100644 --- a/ktlint-cli-reporter-core/src/main/kotlin/com/pinterest/ktlint/cli/reporter/core/api/ReporterV2.kt +++ b/ktlint-cli-reporter-core/src/main/kotlin/com/pinterest/ktlint/cli/reporter/core/api/ReporterV2.kt @@ -2,14 +2,14 @@ package com.pinterest.ktlint.cli.reporter.core.api /** * Implementation must be thread-safe. In particular, [onLintError] might be called in parallel for - * different files (but not for the same file) ([before], [onLintError] and [after] are guarantied to be called + * different files (but not for the same file) ([before], [onLintError] and [after] are guaranteed to be called * on the same thread). * @see ReporterProvider */ public interface ReporterV2 { /** * This function is called once, before the processing begins (regardless of whether any files matching the pattern are (going to) - * found). It's guarantied to be called before any of the other [ReporterV2]s methods. + * found). It's guaranteed to be called before any of the other [ReporterV2]s methods. */ public fun beforeAll() {} @@ -32,7 +32,7 @@ public interface ReporterV2 { public fun after(file: String) {} /** - * This function is called once, after all the files (if any) have been processed. It's guarantied to be called after all other + * This function is called once, after all the files (if any) have been processed. It's guaranteed to be called after all other * [ReporterV2]s methods. */ public fun afterAll() {} diff --git a/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt b/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt index 27e2a9bd67..841ed79189 100644 --- a/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt +++ b/ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt @@ -263,7 +263,7 @@ private fun FileSystem.toGlob( /** * For each double star pattern in the path, create and additional path in which the double start pattern is removed. - * In this way a pattern like some-directory/**/*.kt will match wile files in some-directory or any of its + * In this way a pattern like some-directory/**/*.kt will match while files in some-directory or any of its * subdirectories. */ private fun String?.expandDoubleStarPatterns(): Set { @@ -278,7 +278,7 @@ private fun String?.expandDoubleStarPatterns(): Set { .filter { it !== doubleStarPart } .joinToString(separator = "/") // The original path can contain multiple double star patterns. Replace only one double start pattern - // with an additional path patter and call recursively for remain double star patterns + // with an additional path pattern and call recursively for remain double star patterns paths.addAll(expandedPath.expandDoubleStarPatterns()) } } diff --git a/ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/internal/FileUtilsTest.kt b/ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/internal/FileUtilsTest.kt index 3f9c993ad8..13de99439b 100644 --- a/ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/internal/FileUtilsTest.kt +++ b/ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/internal/FileUtilsTest.kt @@ -258,7 +258,7 @@ internal class FileUtilsTest { } @Test - fun `Given a pattern containing multiple double star patters and a workdir without subdirectories then find all files in that workdir`() { + fun `Given a pattern containing multiple double star patterns and a workdir without subdirectories then find all files in that workdir`() { val foundFiles = getFiles( patterns = @@ -409,7 +409,7 @@ internal class FileUtilsTest { } @Test - fun `Issue 1847 - Given a negate pattern only then include the default patters and select all files except files in the negate pattern`() { + fun `Issue 1847 - Given a negate pattern only then include the default patterns and select all files except files in the negate pattern`() { val foundFiles = getFiles( patterns = diff --git a/ktlint-rule-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/internal/ThreadSafeEditorConfigCacheTest.kt b/ktlint-rule-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/internal/ThreadSafeEditorConfigCacheTest.kt index 143990844b..ff6bcfe33a 100644 --- a/ktlint-rule-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/internal/ThreadSafeEditorConfigCacheTest.kt +++ b/ktlint-rule-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/internal/ThreadSafeEditorConfigCacheTest.kt @@ -34,7 +34,7 @@ class ThreadSafeEditorConfigCacheTest { } @Test - fun `Given that multiple files are stored into the cache and one of those files is requested another time then this file is still being retrived from the cache`() { + fun `Given that multiple files are stored into the cache and one of those files is requested another time then this file is still being retrieved from the cache`() { val threadSafeEditorConfigCache = ThreadSafeEditorConfigCache() val editorConfigLoaderFile1 = EditorConfigLoaderMock(EDIT_CONFIG_1) val editorConfigLoaderFile2 = EditorConfigLoaderMock(EDIT_CONFIG_2) diff --git a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ImportOrderingRule.kt b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ImportOrderingRule.kt index 9c179dfe48..6b7be1659e 100644 --- a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ImportOrderingRule.kt +++ b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ImportOrderingRule.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.psi.KtImportDirective private val LOGGER = KotlinLogging.logger {}.initKtLintKLogger() /** - * Import ordering is configured via EditorConfig's property `ij_kotlin_imports_layout`, so the Kotlin IDE plugin also recongizes it. Supported values: + * Import ordering is configured via EditorConfig's property `ij_kotlin_imports_layout`, so the Kotlin IDE plugin also recognizes it. Supported values: * * "*,java.**,javax.**,kotlin.**,^" - default IntelliJ IDEA's order, see [IDEA_PATTERN] * * "*" - alphabetical order as recommended in Android's Kotlin style guide, see [ASCII_PATTERN] * * custom - defined by the following set of tokens. Tokens can be combined together in a group, groups/tokens must be comma separated: diff --git a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakBeforeAssignmentRule.kt b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakBeforeAssignmentRule.kt index 4503603aaf..6d4b463c8d 100644 --- a/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakBeforeAssignmentRule.kt +++ b/ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakBeforeAssignmentRule.kt @@ -39,7 +39,7 @@ public class NoLineBreakBeforeAssignmentRule : StandardRule("no-line-break-befor emit(unexpectedNewlineBeforeAssignment.startOffset, "Line break before assignment is not allowed", true) if (autoCorrect) { val parent = assignmentNode.treeParent - // Insert assigment surrounded by whitespaces at new position + // Insert assignment surrounded by whitespaces at new position assignmentNode .siblings(false) .takeWhile { it.isWhiteSpace() || it.isPartOfComment() } diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRuleTest.kt index d46d41636c..b86f656af4 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRuleTest.kt @@ -247,7 +247,7 @@ class BinaryExpressionWrappingRuleTest { } @Test - fun `Given a value argument containing a binary expression which causes the line to exceeds tbe maximum line length`() { + fun `Given a value argument containing a binary expression which causes the line to exceeds the maximum line length`() { val code = """ // $MAX_LINE_LENGTH_MARKER $EOL_CHAR diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRuleTest.kt index ac74175544..1340e320be 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRuleTest.kt @@ -614,7 +614,7 @@ class ChainMethodContinuationRuleTest { .addAdditionalRuleProvider { ArgumentListWrappingRule() } .addAdditionalRuleProvider { FunctionLiteralRule() } .hasLintViolations( - // Lint violation below will not be triggered during format as argument-list-wrapping rule prevents this error from occuring + // Lint violation below will not be triggered during format as argument-list-wrapping rule prevents this error from occurring LintViolation(2, 30, "Expected newline before '.'"), LintViolation(3, 30, "Expected newline before '?.'"), ).isFormattedAs(formattedCode) @@ -652,7 +652,7 @@ class ChainMethodContinuationRuleTest { .addAdditionalRuleProvider { IndentationRule() } .isFormattedAs(formattedCode) .hasLintViolations( - // Lint violation below will not be triggered during format as argument-list-wrapping rule prevents this error from occuring + // Lint violation below will not be triggered during format as argument-list-wrapping rule prevents this error from occurring LintViolation(2, 30, "Expected newline before '.'"), LintViolation(3, 30, "Expected newline before '?.'"), ).isFormattedAs(formattedCode) @@ -957,7 +957,7 @@ class ChainMethodContinuationRuleTest { } @Test - fun `Issue 2304 - Given a dot qualified expression in which the call expression returns a function which is called with value argument ans has a trailing lambda`() { + fun `Issue 2304 - Given a dot qualified expression in which the call expression returns a function which is called with value argument and has a trailing lambda`() { val code = """ fun foo(baz: Baz) = diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionExpressionBodyRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionExpressionBodyRuleTest.kt index 13f412d84f..ee04fd45c2 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionExpressionBodyRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionExpressionBodyRuleTest.kt @@ -156,7 +156,7 @@ class FunctionExpressionBodyRuleTest { } @Test - fun `Given a function with a single expression but having multiple return expression inside then do not covert as it results in a compilation error`() { + fun `Given a function with a single expression but having multiple return expression inside then do not convert as it results in a compilation error`() { val code = """ fun foo(): Any { diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IndentationRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IndentationRuleTest.kt index 42a81f7450..395bab814d 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IndentationRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IndentationRuleTest.kt @@ -3270,7 +3270,7 @@ internal class IndentationRuleTest { @Test fun `format raw string literal containing a template string as the first non blank element on the line`() { - // Escape '${true}' as '${"$"}{true}' to prevent evaluation before actually processing the multiline sting + // Escape '${true}' as '${"$"}{true}' to prevent evaluation before actually processing the multiline string val code = """ fun foo() { diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakAfterElseRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakAfterElseRuleTest.kt index b36185dd38..0757f8ac08 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakAfterElseRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoLineBreakAfterElseRuleTest.kt @@ -50,7 +50,7 @@ class NoLineBreakAfterElseRuleTest { } @Test - fun `Given a valid if-else statement then do not return lint errrors`() { + fun `Given a valid if-else statement then do not return lint errors`() { val code = """ fun funA() { diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRuleTest.kt index e13c618de9..d668516bac 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRuleTest.kt @@ -87,7 +87,7 @@ class SpacingAroundCurlyRuleTest { } @Nested - inner class `Given a lamda` { + inner class `Given a lambda` { @Test fun `Given a lambda missing space around opening curly brace`() { val code = diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StatementWrappingRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StatementWrappingRuleTest.kt index d09e31a537..a102b2a45d 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StatementWrappingRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StatementWrappingRuleTest.kt @@ -482,7 +482,7 @@ class StatementWrappingRuleTest { } @Nested - inner class `Issue 1078 - Given multiple expression seperated with semi in a single line` { + inner class `Issue 1078 - Given multiple expression separated with semi in a single line` { @Nested inner class `Given multiple variables` { @Test diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/WrappingRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/WrappingRuleTest.kt index f937fb3c03..06f834a346 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/WrappingRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/WrappingRuleTest.kt @@ -584,7 +584,7 @@ internal class WrappingRuleTest { @Test fun `format multiline string containing a template string as the first non blank element on the line`() { - // Escape '${true}' as '${"$"}{true}' to prevent evaluation before actually processing the multiline sting + // Escape '${true}' as '${"$"}{true}' to prevent evaluation before actually processing the multiline string val code = """ fun foo() { @@ -1453,7 +1453,7 @@ internal class WrappingRuleTest { } @Test - fun `Given a function call and last parameter value is a function call then the clossing parenthesis may be on a single line`() { + fun `Given a function call and last parameter value is a function call then the closing parenthesis may be on a single line`() { val code = """ val foobar = foo("" diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/importordering/ImportOrderingRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/importordering/ImportOrderingRuleTest.kt index 4beb1eb772..503919e794 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/importordering/ImportOrderingRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/importordering/ImportOrderingRuleTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test class ImportOrderingRuleTest { @Test - fun `Given a list of pattern entries then write the patters as comma separated string`() { + fun `Given a list of pattern entries then write the patterns as comma separated string`() { val actual = ImportOrderingRule.IJ_KOTLIN_IMPORTS_LAYOUT_PROPERTY.propertyWriter( listOf( diff --git a/ktlint-test-ruleset-provider-v2-deprecated/README.md b/ktlint-test-ruleset-provider-v2-deprecated/README.md index e2597df29a..375075f959 100644 --- a/ktlint-test-ruleset-provider-v2-deprecated/README.md +++ b/ktlint-test-ruleset-provider-v2-deprecated/README.md @@ -1,6 +1,6 @@ IMPORTANT: This module is kept around for future reference in case the current RuleSetProviderV3 is being deprecated. -This module contains a rule set provider based on the deprecated `com.pinterest.ktlint.core.api.RuleSetProviderV2` which is already removed from the current code base. It wass used to build a custom rule set JAR for testing the `ktlint-cli` module. +This module contains a rule set provider based on the deprecated `com.pinterest.ktlint.core.api.RuleSetProviderV2` which is already removed from the current code base. It was used to build a custom rule set JAR for testing the `ktlint-cli` module. As this module is not meant to be published, you need to build the jar explicitly and copy the jar to the `ktlint-cli` test resource folder: ```shell diff --git a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtLintAssertThat.kt b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtLintAssertThat.kt index 965994ee83..54aa9561bf 100644 --- a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtLintAssertThat.kt +++ b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtLintAssertThat.kt @@ -178,7 +178,7 @@ public class KtLintAssertThat( * additional rule is run first, and if it modifies the AST, this could result in a [LintViolation] for the rule under test which is * executed later than the additional rule. * - * Prefer to use [addAdditionalRuleProvider] when only a singe provider of a rule is to be added. + * Prefer to use [addAdditionalRuleProvider] when only a single provider of a rule is to be added. */ public fun addAdditionalRuleProviders(vararg providers: (() -> Rule)): KtLintAssertThat { additionalRuleProviders.addAll( diff --git a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtlintTestFileSystem.kt b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtlintTestFileSystem.kt index 5e06b899fa..0998f99880 100644 --- a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtlintTestFileSystem.kt +++ b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/KtlintTestFileSystem.kt @@ -105,7 +105,7 @@ public class KtlintTestFileSystem( // On Windows OS the exception below is thrown when not taking the file system root directory into account: // java.nio.file.InvalidPathException: Jimfs does not currently support the Windows syntax for an absolute path on the // current drive (e.g. "\foo\bar"): /project/ - // So first resolve the path starting from the first root directory of the filesystem (not be confused wit the rootDirectory + // So first resolve the path starting from the first root directory of the filesystem (not be confused with the rootDirectory // property of the KtLintTestFileSystem) fileSystemRootPath.resolve(path) } diff --git a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/README.MD b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/README.MD index 59659c88b0..d2c3b5a5b9 100644 --- a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/README.MD +++ b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/README.MD @@ -169,7 +169,7 @@ See next section for special support regarding the `.editorconfig` property `max

Set `.editorconfig` property `max_line_length`

-The `.editorconfig` property `max_line_length` can be set as any other property as described in section above. From a readability perspective it is better to use style below as it more cleary visualizes the end of the line with respect to the source code: +The `.editorconfig` property `max_line_length` can be set as any other property as described in section above. From a readability perspective it is better to use style below as it more clearly visualizes the end of the line with respect to the source code: ```kotlin val code = diff --git a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/ReplaceStringTemplatePlaceholder.kt b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/ReplaceStringTemplatePlaceholder.kt index 49c9ca7260..18f90079ec 100644 --- a/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/ReplaceStringTemplatePlaceholder.kt +++ b/ktlint-test/src/main/kotlin/com/pinterest/ktlint/test/ReplaceStringTemplatePlaceholder.kt @@ -1,7 +1,7 @@ package com.pinterest.ktlint.test /** - * Replace the [placeholder] with an escaped "$" (i.e. "${'$'}") so that the resulting raw sting literal still contains a string template + * Replace the [placeholder] with an escaped "$" (i.e. "${'$'}") so that the resulting raw string literal still contains a string template * which then can be processed by the KtlintRuleEngine. */ public fun String.replaceStringTemplatePlaceholder(placeholder: String = "$."): String = replace(placeholder, "${'$'}")