You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ktlint should not be concerned with a function named "approxE^X". It starts with a lower-case letter contrary to the below error message. Perhaps it violates "camel case" because of non-alphabetic characters.
However I get this ERROR in a Maven build:
[ERROR] src/main/kotlin/demo/KotlinMain.kt:206:9: Function name should start with a lowercase letter (except factory methods) and use camel case (standard:function-naming)
Instructions ask for --log-level=debug, however that is a syntax error. I assume you meant -X or --debug. Output for the Ktlint sections from my Maven build:
Here's where it gets ugly, and I'm only showing output for the file where the issue cropped up:
[DEBUG] Discovered RuleSetProviderV3 'RuleSetId(value=standard)'
[DEBUG] checking format: src/main/kotlin/demo/KotlinMain.kt
[DEBUG] Starting with formatting file 'KotlinMain.kt'
[DEBUG] Effective editorconfig properties for file '/home/binkley/src/kt/kotlin-rational/src/main/kotlin/demo/KotlinMain.kt':
end_of_line: lf
max_line_length: 80
ktlint_code_style: intellij_idea
ktlint_standard_discouraged-comment-location: disabled
ktlint_standard_filename: disabled
ktlint_standard_import-ordering: disabled
ktlint_standard_trailing-comma-on-call-site: disabled
ktlint_standard_trailing-comma-on-declaration-site: disabled
[DEBUG] Rule with id 'standard:argument-list-wrapping' should run after the rule with id 'standard:class-signature'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:indent' should run after the rule with id 'standard:class-signature'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:indent' should run after the rule with id 'standard:trailing-comma-on-call-site'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:indent' should run after the rule with id 'standard:trailing-comma-on-declaration-site'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:max-line-length' should run after the rule with id 'standard:trailing-comma-on-call-site'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:max-line-length' should run after the rule with id 'standard:trailing-comma-on-declaration-site'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rule with id 'standard:argument-list-wrapping' should run after the rule with id 'standard:class-signature'. However, the latter rule is not loaded and is allowed to be ignored. For best results, it is advised load the rule.
[DEBUG] Rules will be executed in order below:
- internal:ktlint-suppression,
- standard:annotation-spacing,
- standard:chain-wrapping,
- standard:class-naming,
- standard:colon-spacing,
- standard:comma-spacing,
- standard:comment-spacing,
- standard:comment-wrapping,
- standard:context-receiver-wrapping,
- standard:curly-spacing,
- standard:dot-spacing,
- standard:double-colon-spacing,
- standard:enum-entry-name-case,
- standard:enum-wrapping,
- standard:final-newline,
- standard:fun-keyword-spacing,
- standard:function-naming,
- standard:function-return-type-spacing,
- standard:function-start-of-body-spacing,
- standard:function-type-reference-spacing,
- standard:kdoc-wrapping,
- standard:keyword-spacing,
- standard:modifier-list-spacing,
- standard:modifier-order,
- standard:multiline-if-else,
- standard:no-blank-line-before-rbrace,
- standard:no-blank-lines-in-chained-method-calls,
- standard:no-consecutive-blank-lines,
- standard:no-empty-class-body,
- standard:no-empty-file,
- standard:no-empty-first-line-in-method-block,
- standard:no-line-break-after-else,
- standard:no-line-break-before-assignment,
- standard:no-wildcard-imports,
- standard:nullable-type-spacing,
- standard:op-spacing,
- standard:package-name,
- standard:parameter-list-spacing,
- standard:parameter-list-wrapping,
- standard:parameter-wrapping,
- standard:paren-spacing,
- standard:property-naming,
- standard:property-wrapping,
- standard:range-spacing,
- standard:spacing-around-angle-brackets,
- standard:spacing-between-declarations-with-annotations,
- standard:spacing-between-declarations-with-comments,
- standard:spacing-between-function-name-and-opening-parenthesis,
- standard:statement-wrapping,
- standard:string-template,
- standard:type-argument-list-spacing,
- standard:type-parameter-list-spacing,
- standard:unary-op-spacing,
- standard:unnecessary-parentheses-before-trailing-lambda,
- standard:annotation,
- standard:wrapping,
- standard:argument-list-wrapping,
- standard:no-semi,
- standard:function-signature,
- standard:indent,
- standard:block-comment-initial-star-alignment,
- standard:max-line-length
[DEBUG] Format could not fix > src/main/kotlin/demo/KotlinMain.kt:207:9: Function name should start with a lowercase letter (except factory methods) and use camel case
[**]
end_of_line = lf
max_line_length = 80
[*.{kt,kts}]
# TODO: Decide if an Android mix makes more sense
ktlint_code_style = intellij_idea
ktlint_standard_discouraged-comment-location = disabled
ktlint_standard_filename = disabled
# Oh, the irony. IntelliJ insists on sorting java* imports last
ktlint_standard_import-ordering = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): Maven 3.8.4 via Maven wrapper
Operating System and version: Linux Hobbiton 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux using WSL under Windows 11 Home latest
The text was updated successfully, but these errors were encountered:
In tests (and only in tests), you can use method names with spaces enclosed in backticks.
Android Kotlin style guide does not mention anything about backticks. But I think it is a commonly accepted guideline to not use method names enclosed in backticks.
Expected Behavior
Ktlint should not be concerned with a function named "approxE^X". It starts with a lower-case letter contrary to the below error message. Perhaps it violates "camel case" because of non-alphabetic characters.
However I get this ERROR in a Maven build:
for https://github.com/binkley/kotlin-rational/blob/9706d9763236a9adda4454d46590431383ad650e/src/main/kotlin/demo/KotlinMain.kt#L206. The function is:
Observed Behavior
Instructions ask for
--log-level=debug
, however that is a syntax error. I assume you meant-X
or--debug
. Output for the Ktlint sections from my Maven build:Here's where it gets ugly, and I'm only showing output for the file where the issue cropped up:
Steps to Reproduce
Latest commit to this repo is binkley/kotlin-rational@e4de9a4 where I suppressed numerous Ktlint 3.0.0 complaints.
Your Environment
.editorconfig
settingsLinux Hobbiton 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
using WSL under Windows 11 Home latestThe text was updated successfully, but these errors were encountered: