diff options
author | Jordan Demeulenaere <jdemeulenaere@google.com> | 2022-06-10 11:53:14 +0200 |
---|---|---|
committer | Jordan Demeulenaere <jdemeulenaere@google.com> | 2022-06-10 10:01:38 +0000 |
commit | de088d407c7ca6bb682527e8e802242668813ed4 (patch) | |
tree | d5f6623e19d9debd425b200c2465f4a652cc1e8d /ktlint.py | |
parent | 1aaf3e4b038980ba4bbe7e08f42aa6949bb1836d (diff) | |
download | ktlint-de088d407c7ca6bb682527e8e802242668813ed4.tar.gz |
Configure ktlint the same way as google3 does
Given that we are going to use ktfmt to format our files and that ktlint
and ktfmt don't agree on indentation rules, let's configure ktlint to
disable rules that clash with ktfmt. The configuration is the same as in
google3 [1] with those additional changes:
* Indentation is set to 4.
* wrapping rule is disabled. This is not disabled in google3 yet
because this rules is causing issue starting from release 0.45 and
google3 is on 0.43 (while we are on 0.46/master).
[1] http://google3/third_party/kotlin/ktlint/.editorconfig
Bug: 235461679
Test: Manual
Change-Id: I851e511db06ae38ea89be0f90a86746a1fa92dac
Diffstat (limited to 'ktlint.py')
-rwxr-xr-x | ktlint.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -28,6 +28,7 @@ import sys MAIN_DIRECTORY = os.path.normpath(os.path.dirname(__file__)) KTLINT_JAR = os.path.join(MAIN_DIRECTORY, 'ktlint-android-all.jar') +EDITOR_CONFIG = os.path.join(MAIN_DIRECTORY, '.editorconfig') FORMAT_MESSAGE = ''' ********************************************************************** To format run: @@ -45,6 +46,7 @@ def main(args=None): args = parser.parse_args() kt_files = [f for f in args.file if f.endswith('.kt') or f.endswith('.kts')] ktlint_args = kt_files[:] + ktlint_args += ['--editorconfig', EDITOR_CONFIG] if args.format: ktlint_args += ['-F'] if not ktlint_args: |