Add code style `ktlint_official` * Add code style `ktlint_official` (functionally equivalent with old `official` code style), `intellij_idea` (replacement for old `official` code style) and `android_studio` (replacement for old `android` code style). Closes #1699 * Format project itself to "official ktlint" codestyle. * Add Gradle "ktlint format" task. * Ensure that the subcommand generateEditorConfig, gitPreCommitHook and gitPrePushHook can receive the code-style before or after the subcommand and print error in case the code style option is not specified explicitly. * Add option to KtLintRuleEngine to ignore the '.editorconfig' on the file system. Unit test classed have to obey to '.editorconfig' settings of the project. Code snippets inside those unit tests should not be influenced by the '.editorconfig' settings of the project but only by properties which have been explicitly defined in the unit test. * Files used for CLI tests contain lint violations on purpose in order to validate the tests. The tests may not be affected by the ".editorconfig" files which are used to lint/format the code of the Ktlint project itself. Neither may the ".editorconfig" files of the project lead to changing the input files for the tests. Files used as input for the cli test use the ".test" extension so that those files can be separated from the actual project files. The tests that used the "filename" rule have been replaced with the "no-wildcard-imports" rule. Reason for this is that the "filename" rule contains a hardcoded check that excludes all files not ending with a ".kt" extension. * Do not add the (first line of the) body expression on the same line as the function signature in case the max line length would be exceeded. `function-signature`. * Do not add the first line of a multiline body expression on the same line as the function signature in case function body expression wrapping property is set to `multiline`. `function-signature`.
.editorconfig supportplain, json, html and checkstyleUser guide
This project is not affiliated with nor endorsed by JetBrains.
All code, unless specified otherwise, is licensed under the MIT license.
Copyright (c) 2019 Pinterest, Inc.
Copyright (c) 2016-2019 Stanley Shyiko.