File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
apply plugin : ' io.gitlab.arturbosch.detekt'
2
2
3
3
detekt {
4
- buildUponDefaultConfig = true // preconfigure defaults
5
- allRules = false // activate all available (even unstable) rules.
6
- config = files(" $rootDir /detekt-config.yml" ) // point to your custom config defining rules to run, overwriting default behavior
4
+ buildUponDefaultConfig = true // preconfigure defaults
5
+ allRules = false // activate all available (even unstable) rules.
6
+ config = files(" $rootDir /detekt-config.yml" )
7
+ // point to your custom config defining rules to run, overwriting default behavior
8
+ }
9
+
10
+ task createDetektPreCommitHook () {
11
+ def gitHooksDirectory = new File (" $project . rootDir /.git/hooks/" )
12
+ if (! gitHooksDirectory. exists()) gitHooksDirectory. mkdirs()
13
+ new File (" $project . rootDir /.git/hooks" , " pre-commit" ). text = """
14
+ #!/bin/bash
15
+ echo "Running detekt check"
16
+ ./scripts/pre-commit.sh
17
+ """
18
+ " chmod +x .git/hooks/pre-commit" . execute()
7
19
}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo " Running detekt check"
3
+ ./gradlew detekt
You can’t perform that action at this time.
0 commit comments