Skip to content

Commit

Permalink
Fix typo's (#2641)
Browse files Browse the repository at this point in the history
Command used:
```
codespell --skip="**/build/*" --ignore-words-list afterall,testng,optin --write-changes
```

See https://pypi.org/project/codespell/
  • Loading branch information
paul-dingemans authored Apr 22, 2024
1 parent 9367b7e commit 32839e1
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 38 deletions.
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions documentation/release-latest/docs/rules/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Wraps each operand in a multiline condition to a separate line.
baz1 ||
(baz2 && baz3)
) {
// do somthing
// do something
}
```

Expand All @@ -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
}
```

Expand Down
4 changes: 2 additions & 2 deletions documentation/snapshot/docs/rules/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ Wraps each operand in a multiline condition to a separate line.
baz1 ||
(baz2 && baz3)
) {
// do somthing
// do something
}
```

Expand All @@ -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
}
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand All @@ -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() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
Expand All @@ -278,7 +278,7 @@ private fun String?.expandDoubleStarPatterns(): Set<String> {
.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())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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(""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion ktlint-test-ruleset-provider-v2-deprecated/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 32839e1

Please sign in to comment.