KyoriPowered / adventure-webui

A web UI for Adventure
https://webui.advntr.dev/
MIT License
27 stars 16 forks source link

chore(deps): Update dependency com.pinterest:ktlint to v0.48.0 #141

Closed renovate[bot] closed 1 year ago

renovate[bot] commented 1 year ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
com.pinterest:ktlint 0.47.1 -> 0.48.0 age adoption passing confidence

Release Notes

pinterest/ktlint ### [`v0.48.0`](https://togithub.com/pinterest/ktlint/blob/HEAD/CHANGELOG.md#​0480---2022-12-15) [Compare Source](https://togithub.com/pinterest/ktlint/compare/0.47.1...0.48.0) ##### Indent rule The `indent` rule has been rewritten from scratch. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well. ##### `.editorconfig` property to disable rules In the previous release (0.47.x), the `.editorconfig` property `disabled_rules` was deprecated and replaced with `ktlint_disabled_rules`. This latter property has now been deprecated as well in favour of a more flexible and better maintainable solution. Rule and rule sets can now be enabled/disabled with a separate property per rule (set). Please read [deprecation of (ktlint\_)disable_rules property](https://pinterest.github.io/ktlint/faq/#why-is-editorconfig-property-disabled_rules-deprecated-and-how-do-i-resolve-this) for more information. The KtLint CLI has not been changed. Although you can still use parameter `--experimental` to enable KtLint's Experimental rule set, you might want to set `.editorconfig` property `ktlint_experimental = enabled` instead. ##### API Changes & RuleSet providers If you are not an API consumer or Rule Set provider then you can skip this section. ##### Class relocations Classes below have been relocated: - Class `com.pinterest.ktlint.core.api.UsesEditorConfigProperties.EditorConfigProperty` has been replaced with `com.pinterest.ktlint.core.api.editorconfig.EditorConfigProperty`. - Class `com.pinterest.ktlint.core.KtLintParseException` has been replaced with `com.pinterest.ktlint.core.api.KtLintParseException`. - Class `com.pinterest.ktlint.core.RuleExecutionException` has been replaced with `com.pinterest.ktlint.core.api.KtLintRuleException`. - Class `com.pinterest.ktlint.reporter.format.internal.Color` has been moved to `com.pinterest.ktlint.reporter.format.Color`. - Class `com.pinterest.ktlint.reporter.plain.internal.Color` has been moved to `com.pinterest.ktlint.reporter.plain.Color`. ##### Invoking `lint` and `format` This is the last release that supports the `ExperimentalParams` to invoke the `lint` and `format` functions of KtLint. The `ExperimentalParams` contains a mix of configuration settings which are not dependent on the file/code which is to be processed. Other parameters in that class describe the code/file to be processed but can be configured inconsistently (for example a file with name "foo.kt" could be marked as a Kotlin Script file). The static object `KtLint` is deprecated and replaced by class `KtLintRuleEngine` which is configured with `KtLintRuleEngineConfiguration`. The instance of the `KtLintRuleEngine` is intended to be reused for scanning all files in a project and should not be recreated per file. Both `lint` and `format` are simplified and can now be called for a code block or for an entire file. ```kotlin import java.io.File // Define a reusable instance of the KtLint Rule Engine val ktLintRuleEngine = KtLintRuleEngine( // Define configuration ) // Process a collection of files val files: Set // Collect files in a convenient way files.forEach(file in files) { ktLintRuleEngine.lint(file) { // Handle lint violations } } // or process a code sample for a given filepath ktLintRuleEngine.lint( code = "code to be linted", filePath = Path("/path/to/source/file") ) { // Handle lint violations } ``` ##### Retrieve `.editorconfig`s The list of `.editorconfig` files which will be accessed by KtLint when linting or formatting a given path can now be retrieved with the new API `KtLint.editorConfigFilePaths(path: Path): List`. This API can be called with either a file or a directory. It's intended usage is that it is called once with the root directory of a project before actually linting or formatting files of that project. When called with a directory path, all `.editorconfig` files in the directory or any of its subdirectories (except hidden directories) are returned. In case the given directory does not contain an `.editorconfig` file or if it does not contain the `root=true` setting, the parent directories are scanned as well until a root `.editorconfig` file is found. Calling this API with a file path results in the `.editorconfig` files that will be accessed when processing that specific file. In case the directory in which the file resides does not contain an `.editorconfig` file or if it does not contain the `root=true` setting, the parent directories are scanned until a root `.editorconfig` file is found. ##### Psi filename replaces FILE_PATH_USER_DATA_KEY Constant `KtLint.FILE_PATH_USER_DATA_KEY` is deprecated and will be removed in KtLint version 0.49.0. The file name will be passed correctly to the node with element type FILE and can be retrieved as follows: ```kotlin if (node.isRoot()) { val fileName = (node.psi as? KtFile)?.name ... } ``` ##### Added - Wrap blocks in case the max line length is exceeded or in case the block contains a new line `wrapping` ([#​1643](https://togithub.com/pinterest/ktlint/issue/1643)) - patterns can be read in from `stdin` with the `--patterns-from-stdin` command line options/flags ([#​1606](https://togithub.com/pinterest/ktlint/pull/1606)) - Add basic formatting for context receiver in `indent` rule and new experimental rule `context-receiver-wrapping` ([#​1672](https://togithub.com/pinterest/ktlint/issue/1672)) - Add naming rules for classes and objects (`class-naming`), functions (`function-naming`) and properties (`property-naming`) ([#​44](https://togithub.com/pinterest/ktlint/issue/44)) - Add new built-in reporter `plain-summary` which prints a summary the number of violation which have been autocorrected or could not be autocorrected, both split by rule. ##### Fixed - Let a rule process all nodes even in case the rule is suppressed for a node so that the rule can update the internal state ([#​1644](https://togithub.com/pinterest/ktlint/issue/1644)) - Read `.editorconfig` when running CLI with options `--stdin` and `--editorconfig` ([#​1651](https://togithub.com/pinterest/ktlint/issue/1651)) - Do not add a trailing comma in case a multiline function call argument is found but no newline between the arguments `trailing-comma-on-call-site` ([#​1642](https://togithub.com/pinterest/ktlint/issue/1642)) - Add missing `ktlint_disabled_rules` to exposed `editorConfigProperties` ([#​1671](https://togithub.com/pinterest/ktlint/issue/1671)) - Do not add a second trailing comma, if the original trailing comma is followed by a KDOC `trailing-comma-on-declaration-site` and `trailing-comma-on-call-site` ([#​1676](https://togithub.com/pinterest/ktlint/issue/1676)) - A function signature preceded by an annotation array should be handled similar as function preceded by a singular annotation `function-signature` ([#​1690](https://togithub.com/pinterest/ktlint/issue/1690)) - Fix offset of annotation violations - Fix line offset when blank line found between class and primary constructor - Remove needless blank line between class followed by EOL, and primary constructor - Fix offset of unexpected linebreak before assignment - Remove whitespace before redundant semicolon if the semicolon is followed by whitespace ##### Changed - Update Kotlin development version to `1.8.0-RC` and Kotlin version to `1.7.21`. - The default value for trailing comma's on call site is changed to `true` unless the `android codestyle` is enabled. Note that KtLint from a consistency viewpoint *enforces* the trailing comma on call site while default IntelliJ IDEA formatting only *allows* the trailing comma but leaves it up to the developer's discretion. ([#​1670](https://togithub.com/pinterest/ktlint/pull/1670)) - The default value for trailing comma's on declaration site is changed to `true` unless the `android codestyle` is enabled. Note that KtLint from a consistency viewpoint *enforces* the trailing comma on declaration site while default IntelliJ IDEA formatting only *allows* the trailing comma but leaves it up to the developer's discretion. ([#​1669](https://togithub.com/pinterest/ktlint/pull/1669)) - CLI options `--debug`, `--trace`, `--verbose` and `-v` are replaced with `--log-level=` or the short version \`-l=, see [CLI log-level](https://pinterest.github.io/ktlint/install/cli/#logging). ([#​1632](https://togithub.com/pinterest/ktlint/issue/1632)) - In CLI, disable logging entirely by setting `--log-level=none` or `-l=none` ([#​1652](https://togithub.com/pinterest/ktlint/issue/1652)) - Rewrite `indent` rule. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well. ([#​1682](https://togithub.com/pinterest/ktlint/pull/1682), [#​1321](https://togithub.com/pinterest/ktlint/issues/1321), [#​1200](https://togithub.com/pinterest/ktlint/issues/1200), [#​1562](https://togithub.com/pinterest/ktlint/issues/1562), [#​1563](https://togithub.com/pinterest/ktlint/issues/1563), [#​1639](https://togithub.com/pinterest/ktlint/issues/1639)) - Add methods "ASTNode.upsertWhitespaceBeforeMe" and "ASTNode.upsertWhitespaceAfterMe" as replacements for "LeafElement.upsertWhitespaceBeforeMe" and "LeafElement.upsertWhitespaceAfterMe". The new methods are more versatile and allow code to be written more readable in most places. ([#​1687](https://togithub.com/pinterest/ktlint/pull/1687)) - Rewrite `indent` rule. Solving problems in the old algorithm was very difficult. With the new algorithm this becomes a lot easier. Although the new implementation of the rule has been compared against several open source projects containing over 400,000 lines of code, it is still likely that new issues will be discovered. Please report your indentation issues so that these can be fixed as well. ([#​1682](https://togithub.com/pinterest/ktlint/pull/1682), [#​1321](https://togithub.com/pinterest/ktlint/issues/1321), [#​1200](https://togithub.com/pinterest/ktlint/issues/1200), [#​1562](https://togithub.com/pinterest/ktlint/issues/1562), [#​1563](https://togithub.com/pinterest/ktlint/issues/1563), [#​1639](https://togithub.com/pinterest/ktlint/issues/1639), [#​1688](https://togithub.com/pinterest/ktlint/issues/1688)) - Add support for running tests on `java 19`, remove support for running tests on `java 18`. - Update `io.github.detekt.sarif4k:sarif4k` version to `0.2.0` ([#​1701](https://togithub.com/pinterest/ktlint/issues/1701)).

Configuration

📅 Schedule: Branch creation - "after 5pm on the 2nd day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR has been generated by Mend Renovate. View repository job log here.