Skip to content

Commit

Permalink
Fixed warnings and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoppier committed Jul 5, 2024
1 parent 293ae5c commit 4c9bc92
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ val IDENTIFIER_FROM_EXPRESSION = Name.identifier("fromExpression")

val IDENTIFIER_PARAMETER = Name.identifier("parameter")

val IDENTIFIER_TRANFORM = Name.identifier("transform")
val IDENTIFIER_TRANSFORM = Name.identifier("transform")

val IDENTIFIER_VIA = Name.identifier("via")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private class ObjectBodyStatementCollector(file: IrFileEntry)
expression,
)
}
IDENTIFIER_TRANFORM -> {
IDENTIFIER_TRANSFORM -> {
val mapping = expression.dispatchReceiver!!.accept(data)!!
val transformation = expression.valueArguments.first()!! as IrFunctionExpression
mapping.first to (mapping.second as PropertySource).copy(transformation = transformation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import tech.mappie.testing.compilation.KotlinCompilation
import tech.mappie.testing.compilation.KotlinCompilation.ExitCode
import tech.mappie.testing.compilation.SourceFile.Companion.kotlin
import tech.mappie.testing.containsError
import tech.mappie.testing.loadObjectMappie2Class
import tech.mappie.testing.loadObjectMappie3Class
import java.io.File

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.junit.jupiter.api.io.TempDir
import tech.mappie.testing.compilation.KotlinCompilation
import tech.mappie.testing.compilation.KotlinCompilation.ExitCode
import tech.mappie.testing.compilation.SourceFile.Companion.kotlin
import tech.mappie.testing.loadObjectMappie2Class
import tech.mappie.testing.loadObjectMappie3Class
import java.io.File

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ abstract class AbstractKotlinCompilation<A : CommonCompilerArguments> internal c

protected val hostClasspaths by lazy { HostEnvironment.classpath }

/* This internal buffer and stream is used so it can be easily converted to a string
/* This internal buffer and stream is used, so it can be easily converted to a string
that is put into the [Result] object, in addition to printing immediately to the user's
stream. */
protected val internalMessageBuffer = Buffer()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package tech.mappie.testing.compilation

import java.io.*
import java.net.URL
import java.net.URLClassLoader
import java.nio.file.*
import javax.lang.model.SourceVersion

internal fun getJavaHome(): File {
Expand All @@ -26,7 +23,7 @@ internal fun isJdk9OrLater(): Boolean =
SourceVersion.latestSupported() > SourceVersion.RELEASE_8

internal fun File.listFilesRecursively(): List<File> {
return (listFiles() ?: throw RuntimeException("listFiles() was null. File is not a directory or I/O error occured"))
return (listFiles() ?: throw RuntimeException("listFiles() was null. File is not a directory or I/O error occurred"))
.flatMap { file ->
if(file.isDirectory)
file.listFilesRecursively()
Expand All @@ -37,8 +34,6 @@ internal fun File.listFilesRecursively(): List<File> {

internal fun File.hasKotlinFileExtension() = hasFileExtension(listOf("kt", "kts"))

internal fun File.hasJavaFileExtension() = hasFileExtension(listOf("java"))

internal fun File.hasFileExtension(extensions: List<String>)
= extensions.any{ it.equals(extension, ignoreCase = true) }

Expand Down
2 changes: 2 additions & 0 deletions gradle-plugin/src/main/kotlin/tech/mappie/MappieExtension.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("unused")

package tech.mappie

import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("unused")

package tech.mappie

import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("UNUSED_PARAMETER")
@file:Suppress("unused", "UNUSED_PARAMETER")

package tech.mappie.api

Expand Down
2 changes: 1 addition & 1 deletion website/src/_data/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"authorName": "Stefan Koppier",
"copyright": "Some rights reserved.",
"name": "Mappie",
"slogen": "Mappie: a Kotlin object mapper",
"slogan": "Mappie: a Kotlin object mapper",
"social": {
"github": "https://github.com/Mr-Mappie/mappie",
"discord": ""
Expand Down
4 changes: 2 additions & 2 deletions website/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ faqs:
- title: "How does Mappie compare to ShapeShift?"
description: "
Both Mappie and ShapeShift are built for the Kotlin ecosystem. Mappie generates code at compile-time, while
ShapeShift resolves it's mappings via reflection. This results in a big performance penalty.
ShapeShift resolves its mappings via reflection. This results in a big performance penalty.
The design choices of ShapeShift and Mappie are different. For example, ShapeShift requires the target
classes to have a no-arg constructor, and mapping purely on properties, limiting the flexibility of your code
base.
As Mappie in it's early stages, ShapeShift does has more built-in support for advanced use-cases while Mappie
As Mappie in its early stages, ShapeShift does have more built-in support for advanced use-cases while Mappie
sometimes needs to fall back on more generic operations.
"
---
2 changes: 1 addition & 1 deletion website/src/posts/getting-started/posts/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ compile-time with minimal overhead.
Mappie can generate mappers for objects and enums. It aims to be easy to use, infer as much implicit mappings as possible,
have a consistent API, and have the same runtime performance as if one would write the mapping code manually.

The following snipper gives a small overview of the features of Mappie
The following snippet gives a small overview of the features of Mappie
```kotlin
data class Person(
val name: String,
Expand Down
2 changes: 1 addition & 1 deletion website/src/posts/object-mapping/posts/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and we have a data class `BookDto` containing a list of strings
data class BookDto(val pages: List<String>)
```

We can defined a mapping between `Book` and `BookDto` by defining two mappers: a mapper for `Page` to `String`, which simply
We can define a mapping between `Book` and `BookDto` by defining two mappers: a mapper for `Page` to `String`, which simply
gets the `text` property, and mapper between `Book` and `BookDto` using the inner `forList` mapper of the `PageMapper`
```kotlin
object PageMapper : ObjectMappie<Page, String>() {
Expand Down

0 comments on commit 4c9bc92

Please sign in to comment.