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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Install pre-commit hook for linting #241

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e

./gradlew lintKotlin
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ tasks.named('coverallsJacoco') {
dependsOn jacocoAggregatedReport
}

//tasks.named('check') {
// dependsOn 'installKotlinterPrePushHook'
//}
tasks.create(name:"installLocalGitHooks", type: Copy) {
from("$rootDir/.githooks")
into("$rootDir/.git/hooks")

fileMode = 509 // = 775 in octal
}

tasks.create('check') {
dependsOn installLocalGitHooks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you found why installKotlinterPrePushHook from kotlinter doesn't work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I didn't realise installKotlinterPrePushHook was a feature kotlinter came with. It does work like this, so I've moved to using that instead!

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.pleo.prop.core.Prop
import javax.inject.Inject
import javax.inject.Named

@Suppress("unused")
@Suppress("unused", "UNUSED_PARAMETER")
class NullValue
@Inject
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.pleo.prop.objects
import io.pleo.prop.core.Prop
import javax.inject.Inject

@Suppress("unused")
@Suppress("unused", "UNUSED_PARAMETER")
class UnnamedProp
@Inject
constructor(unnamedProp: Prop<String>)