Skip to content

Commit

Permalink
add already existing helpers and extensions to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Jan 16, 2024
1 parent 8268e5f commit 908915c
Show file tree
Hide file tree
Showing 99 changed files with 7,682 additions and 196 deletions.
7 changes: 1 addition & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@

### Feature

- added the following helpers and extensions:
- Collectors
- DSLContextExt
- FieldExt
- Logging
- RecordExt
- initialize the project with the already existing helpers and extensions
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This project contains opinionated helpers and extensions of [jOOQ](https://github.com/jOOQ/jOOQ) used at Lovely Systems.

Built on **jOOQ 3.18.6**.

## Prerequisites

- Java 17 installed and selected by default

## Generating HTML docs

In case you would like to release a new version, it's also important to update the generated docs via Dokka. To do so, you can run:

```shell
./gradlew dokkaHtml
```

The generated docs will be available under [docs/html/index.html](docs/html/index.html).
36 changes: 33 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,40 @@ plugins {
kotlin("jvm")
id("com.lovelysystems.gradle")
id("io.gitlab.arturbosch.detekt")
id("org.jetbrains.kotlinx.kover")
id("org.jetbrains.dokka")
`maven-publish`
}

group = "com.lovelysystems"

kotlin {
jvmToolchain(17)
}

group = "com.lovelysystems"

lovely {
gitProject()
}

koverReport {
defaults {
verify {
onCheck = true
rule {
bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.INSTRUCTION
}
}
}
}
}

tasks.dokkaHtml {
// TODO introduce the versioning plugin and publish the docs on tag creation to GH pages
outputDirectory.set(projectDir.resolve("docs/html"))
}

if (JavaVersion.current() != JavaVersion.VERSION_17) {
// we require Java 17 here, to ensure we are always using the same version as the docker images are using
error("Java 17 is required for this Project, found ${JavaVersion.current()}")
Expand All @@ -34,7 +55,16 @@ dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.reactive)
implementation(libs.bundles.jooq)
implementation(libs.microutils.logging)
implementation(libs.spotbugs.annotations)
implementation(libs.slf4j.api)

testImplementation(testLibs.kotest.runner)
testImplementation(testLibs.kotest.extensions.testcontainers)
testImplementation(testLibs.testcontainers.r2dbc)
testImplementation(testLibs.testcontainers.postgres)
testImplementation(testLibs.r2dbc.postgresql)
testImplementation(testLibs.jooq.codegen)
testImplementation(testLibs.logback)
}

publishing {
Expand Down
72 changes: 36 additions & 36 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ build:
maxIssues: 0
excludeCorrectable: false
weights:
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1

config:
validation: true
Expand Down Expand Up @@ -34,12 +34,12 @@ processors:
console-reports:
active: true
exclude:
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
- 'FindingsReport'
# - 'FileBasedFindingsReport'
- 'LiteFindingsReport'
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
- 'FindingsReport'
# - 'FileBasedFindingsReport'
- 'LiteFindingsReport'

output-reports:
active: true
Expand Down Expand Up @@ -67,27 +67,27 @@ comments:
endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
KDocReferencesNonPublicProperty:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
OutdatedDocumentation:
active: false
matchTypeParameters: true
matchDeclarationsOrder: true
allowParamOnConstructorProperties: false
UndocumentedPublicClass:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
searchInNestedClass: true
searchInInnerClass: true
searchInInnerObject: true
searchInInnerInterface: true
searchInProtectedClass: false
UndocumentedPublicFunction:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
searchProtectedFunction: false
UndocumentedPublicProperty:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
searchProtectedProperty: false

complexity:
Expand Down Expand Up @@ -122,7 +122,7 @@ complexity:
- 'with'
LabeledExpression:
active: false
ignoredLabels: []
ignoredLabels: [ ]
LargeClass:
active: true
threshold: 600
Expand All @@ -135,7 +135,7 @@ complexity:
constructorThreshold: 7
ignoreDefaultParameters: false
ignoreDataClasses: true
ignoreAnnotatedParameter: []
ignoreAnnotatedParameter: [ ]
MethodOverloading:
active: false
threshold: 6
Expand All @@ -159,14 +159,14 @@ complexity:
active: false
StringLiteralDuplication:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
threshold: 3
ignoreAnnotation: true
excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
thresholdInFiles: 11
thresholdInClasses: 11
thresholdInInterfaces: 11
Expand Down Expand Up @@ -243,7 +243,7 @@ exceptions:
- 'toString'
InstanceOfCheckForException:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
NotImplementedDeclaration:
active: false
ObjectExtendsThrowable:
Expand All @@ -269,7 +269,7 @@ exceptions:
active: false
ThrowingExceptionsWithoutMessageOrCause:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
exceptions:
- 'ArrayIndexOutOfBoundsException'
- 'Exception'
Expand All @@ -284,7 +284,7 @@ exceptions:
active: true
TooGenericExceptionCaught:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
exceptionNames:
- 'ArrayIndexOutOfBoundsException'
- 'Error'
Expand Down Expand Up @@ -321,7 +321,7 @@ naming:
enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName:
active: false
forbiddenName: []
forbiddenName: [ ]
FunctionMaxLength:
active: false
maximumFunctionNameLength: 30
Expand All @@ -330,7 +330,7 @@ naming:
minimumFunctionNameLength: 3
FunctionNaming:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
functionPattern: '[a-z][a-zA-Z0-9]*'
excludeClassPattern: '$^'
FunctionParameterNaming:
Expand Down Expand Up @@ -388,10 +388,10 @@ performance:
threshold: 3
ForEachOnRange:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
SpreadOperator:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
UnnecessaryPartOfBinaryExpression:
active: false
UnnecessaryTemporaryInstantiation:
Expand Down Expand Up @@ -424,7 +424,7 @@ potential-bugs:
- 'java.util.HashMap'
ElseCaseInsteadOfExhaustiveWhen:
active: false
ignoredSubjectTypes: []
ignoredSubjectTypes: [ ]
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
Expand All @@ -450,7 +450,7 @@ potential-bugs:
- 'kotlin.sequences.Sequence'
- 'kotlinx.coroutines.flow.*Flow'
- 'java.util.stream.*Stream'
ignoreFunctionCall: []
ignoreFunctionCall: [ ]
ImplicitDefaultLocale:
active: true
ImplicitUnitReturnType:
Expand All @@ -464,13 +464,13 @@ potential-bugs:
active: true
LateinitUsage:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator:
active: true
MissingPackageDeclaration:
active: false
excludes: ['**/*.kts']
excludes: [ '**/*.kts' ]
NullCheckOnMutableProperty:
active: false
NullableToStringCall:
Expand All @@ -491,7 +491,7 @@ potential-bugs:
active: true
UnsafeCallOnNullableType:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ]
UnsafeCast:
active: true
UnusedUnaryOperator:
Expand Down Expand Up @@ -582,7 +582,7 @@ style:
allowedPatterns: ''
ForbiddenImport:
active: false
imports: []
imports: [ ]
forbiddenPatterns: ''
ForbiddenMethodCall:
active: false
Expand All @@ -593,7 +593,7 @@ style:
value: 'kotlin.io.println'
ForbiddenSuppress:
active: false
rules: []
rules: [ ]
ForbiddenVoid:
active: true
ignoreOverridden: false
Expand All @@ -602,13 +602,13 @@ style:
active: true
ignoreOverridableFunction: true
ignoreActualFunction: true
excludedFunctions: []
excludedFunctions: [ ]
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
MagicNumber:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts' ]
ignoreNumbers:
- '-1'
- '0'
Expand All @@ -634,7 +634,7 @@ style:
maxLineLength: 120
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
excludeCommentStatements: true
excludeRawStrings: true
MayBeConst:
active: true
Expand Down Expand Up @@ -689,7 +689,7 @@ style:
StringShouldBeRawString:
active: false
maxEscapedCharacterCount: 2
ignoredCharacters: []
ignoredCharacters: [ ]
ThrowsCount:
active: true
max: 2
Expand Down
8 changes: 8 additions & 0 deletions docs/html/images/anchor-copy-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/html/images/arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/html/images/burger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/html/images/copy-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/html/images/copy-successful-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/html/images/footer-go-to-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 908915c

Please sign in to comment.