Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit 045d14c

Browse files
authored
Replace ktlint by detekt (#27)
1 parent 85da3ea commit 045d14c

File tree

5 files changed

+838
-3
lines changed

5 files changed

+838
-3
lines changed

.github/workflows/Build.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,11 @@ jobs:
2828
- name: Setup Gradle
2929
uses: gradle/gradle-build-action@v2
3030

31-
- name: unit test, ktlint and public api check
32-
run: ./gradlew ktlintCheck test check --stacktrace
31+
- name: check codeStyle
32+
run: ./gradlew detekt --stacktrace
33+
34+
- name: check public api changes
35+
run: ./gradlew check --stacktrace
36+
37+
- name: run unit tests
38+
run: ./gradlew test --stacktrace

check_code.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./gradlew detekt check test --stacktrace

detekt/baseline.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<SmellBaseline>
3+
<ManuallySuppressedIssues/>
4+
<CurrentIssues>
5+
<ID>ForbiddenComment:IpValidable.kt$IpValidable$* Validates that a value is a valid IP address * TODO: add support for IP v6</ID>
6+
<ID>ForbiddenComment:RangeValidableTest.kt$RangeValidableTest$// TODO: handle floats</ID>
7+
<ID>LongMethod:UrlValidableTest.kt$UrlValidableTest$private fun getValidUrls(): List&lt;String></ID>
8+
<ID>MaxLineLength:HostnameValidable.kt$"^(?!-)(?!.*\\d+\\.\\d+\\.\\d+\\.\\d+)(?!.*\\.example\$)(?!.*\\.invalid\$)(?!.*\\.localhost\$)(?!.*\\.test\$)[A-Za-z0-9-]{1,63}(?&lt;!-)(\\.[A-Za-z0-9-]{1,63})*\$"</ID>
9+
<ID>MaxLineLength:IpValidable.kt$private const val IP_V4_PATTERN = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\$"</ID>
10+
<ID>SwallowedException:GreaterThanOrEqualValidable.kt$GreaterThanOrEqualValidable$e: Exception</ID>
11+
<ID>SwallowedException:GreaterThanValidable.kt$GreaterThanValidable$e: Exception</ID>
12+
<ID>SwallowedException:LessThanOrEqualValidable.kt$LessThanOrEqualValidable$e: Exception</ID>
13+
<ID>SwallowedException:LessThanValidable.kt$LessThanValidable$e: Exception</ID>
14+
<ID>SwallowedException:NegativeOrZeroValidable.kt$NegativeOrZeroValidable$e: Exception</ID>
15+
<ID>SwallowedException:NegativeValidable.kt$NegativeValidable$e: Exception</ID>
16+
<ID>SwallowedException:PositiveOrZeroValidable.kt$PositiveOrZeroValidable$e: Exception</ID>
17+
<ID>SwallowedException:PositiveValidable.kt$PositiveValidable$e: Exception</ID>
18+
<ID>SwallowedException:RangeValidable.kt$RangeValidable$e: Exception</ID>
19+
<ID>TooGenericExceptionCaught:GreaterThanOrEqualValidable.kt$GreaterThanOrEqualValidable$e: Exception</ID>
20+
<ID>TooGenericExceptionCaught:GreaterThanValidable.kt$GreaterThanValidable$e: Exception</ID>
21+
<ID>TooGenericExceptionCaught:LessThanOrEqualValidable.kt$LessThanOrEqualValidable$e: Exception</ID>
22+
<ID>TooGenericExceptionCaught:LessThanValidable.kt$LessThanValidable$e: Exception</ID>
23+
<ID>TooGenericExceptionCaught:NegativeOrZeroValidable.kt$NegativeOrZeroValidable$e: Exception</ID>
24+
<ID>TooGenericExceptionCaught:NegativeValidable.kt$NegativeValidable$e: Exception</ID>
25+
<ID>TooGenericExceptionCaught:PositiveOrZeroValidable.kt$PositiveOrZeroValidable$e: Exception</ID>
26+
<ID>TooGenericExceptionCaught:PositiveValidable.kt$PositiveValidable$e: Exception</ID>
27+
<ID>TooGenericExceptionCaught:RangeValidable.kt$RangeValidable$e: Exception</ID>
28+
</CurrentIssues>
29+
</SmellBaseline>

0 commit comments

Comments
 (0)