Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom configuration is not used when using command-line formatting #34

Closed
GoldSubmarine opened this issue Jun 8, 2021 · 7 comments 路 Fixed by #36
Closed

Custom configuration is not used when using command-line formatting #34

GoldSubmarine opened this issue Jun 8, 2021 · 7 comments 路 Fixed by #36

Comments

@GoldSubmarine
Copy link
Contributor

馃悰 Describe the bug

Custom configuration is not used when using command-line formatting

鈿狅笍 Current behavior

Use the ./gradlew ktfmtFormat command to format the code

image

Use the ./gradlew ktfmtPrecommit --include-only="......." command to format the code

image

My configuration file is as follows

ktfmt {
    kotlinLangStyle()
    maxWidth.set(120)
}

馃摫 Tech info

  • Device: dell
  • OS: Win10
  • Library/App version: 0.6.0
@cortinico
Copy link
Owner

Can you paste the code where you define the ktfmtPrecommit task?

@GoldSubmarine
Copy link
Contributor Author

tasks.register<KtfmtFormatTask>("ktfmtPrecommit") {
    source = project.fileTree(rootDir)
    include("**/*.kt")
}

@cortinico
Copy link
Owner

Thanks. So I need to fix this internally. Ideally the task should check if there is a ktfmt{} extension registered before falling back to default values.

@cortinico
Copy link
Owner

Sorry this took a bit longer, but #36 should address your scenario

@GoldSubmarine
Copy link
Contributor Author

Hi, can you merge the PR, and publish a new version?

@cortinico
Copy link
Owner

Hi, can you merge the PR, and publish a new version?

Yup I'll do it in the next days 馃憤

@cortinico
Copy link
Owner

Shipped in version 0.7.0 of the plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants