We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm wondering if it possible to run
./gradlew formatKotlin -Pfiles = {path to file}
or something like that.
Thanks.
The text was updated successfully, but these errors were encountered:
I can think of:
tasks.register("sampleTask", org.jmailen.gradle.kotlinter.tasks.FormatTask) { source project.property("files") }
which would allow you to call ./gradlew sampleTask -Pfiles={path relative to project directory}
./gradlew sampleTask -Pfiles={path relative to project directory}
Can you describe your use case?
Sorry, something went wrong.
Yeh, use very similar solution in our project. That's only for the formatting in the pre commit hook.
#!/bin/sh set -e echo 1>&2 "running formatKotlin" filesToFormat="$(git --no-pager diff --name-status --no-color --cached | awk '$1 != "D" && $2 ~ /\.kts|\.kt/ { print $2}')" echo "files to format $filesToFormat" for sourceFilePath in $filesToFormat do ./gradlew formatKotlinFile -Pfile="$(pwd)/$sourceFilePath" git add "$sourceFilePath" done;
I know it wont work perfect for the partial commit, but it's fine for us now.
Hope you'll adjust your own pre commit hooks and I switch on it.
We have exactly the same use case. Any updates or workarounds on this specific use case so far?
No branches or pull requests
Hi,
I'm wondering if it possible to run
or something like that.
Thanks.
The text was updated successfully, but these errors were encountered: