Focus of the plugin is shifted to force use of formatting by KtLint. This prevents developers from fixing errors manually which can be fixed by KtLint.
Remove properties from Plugin settings
- "annotateAs": all violations that can not be fixed automatically by KtLint are displayed as errors as they have to be fixed manually by the developer.
- "lintAfterReformat": formatting by KtLint is always executed after core formatting by IntelliJ IDEA.
- "formatOnSave": formatting by KtLint is always executed after the document is saved
Simplify all hooks by moving checks which are blocking ktlint format into the ktlintFormat method
Use ContentIterator for iterating over files that need to be formatted. Iterating using a recursive method call with a VirtualFile as parameter is discouraged as symbolic links can result in endless loops.
Remove "DisablePluginIntention" to prevent accidental disabling of the plugin. The plugin can be disabled via the plugin settings page.
Remove "FormatIntention" as formatting is executed always.
Add intention to add suppress annotation
The 'Suppress' annotation is added in an indirect way by adding the deprecated "ktlint-disable" directive. This directive does not become visible as due to the change of the Psi, ktlint will be run again and the directive will be replaced with the 'Suppress' annotation by Ktlint rule `ktlint-suppression'.
Rewrite to "Official" plugin
Focus of the plugin is shifted to force use of formatting by KtLint. This prevents developers from fixing errors manually which can be fixed by KtLint.
Add intention to add suppress annotation
The 'Suppress' annotation is added in an indirect way by adding the deprecated "ktlint-disable" directive. This directive does not become visible as due to the change of the Psi, ktlint will be run again and the directive will be replaced with the 'Suppress' annotation by Ktlint rule `ktlint-suppression'.
Closes #339