From dacae696bd4ff861275f4a34498dbbabdd5d26b1 Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sat, 21 Sep 2024 11:11:20 +0200 Subject: [PATCH 1/5] Configure sonar build --- README.md | 21 +++++++++++++++++++++ build.gradle | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/README.md b/README.md index 888d767..20c46e6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # java-lua An experimental Java library for embedding a Lua VM. + +[![Build](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml/badge.svg)](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jlua) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=bugs)](https://sonarcloud.io/summary/new_code?id=jlua) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=jlua) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=coverage)](https://sonarcloud.io/summary/new_code?id=jlua) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=jlua) + +## Development + +### Check for Dependency Updates + +```sh +./gradlew dependencyUpdates +``` + +### Run Tests + +```sh +./gradlew check +``` diff --git a/build.gradle b/build.gradle index c434917..38d458b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,8 @@ plugins { id 'java-library' + id 'jacoco' id "com.github.ben-manes.versions" version "0.51.0" + id "org.sonarqube" version "5.1.0.4882" } repositories { @@ -19,6 +21,29 @@ java { } } +javadoc { + enabled = true + failOnError = true + excludes = ["org/itsallcode/jlua/ffi/**"] + options.addBooleanOption('html5', true) + options.addStringOption('Xwerror', '-quiet') +} + +jacocoTestReport { + reports { + xml.required = true + } +} + +sonarqube { + properties { + property "sonar.host.url", "https://sonarcloud.io" + property "sonar.organization", "kaklakariada-github" + } +} + +tasks.sonarqube.dependsOn([tasks.jacocoTestReport]) + testing { suites { test { From 91950649064e6cd044efa51e11c437679cd93421 Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sun, 22 Sep 2024 10:37:21 +0200 Subject: [PATCH 2/5] Rename project to luava --- .vscode/settings.json | 6 +++++- README.md | 12 ++++++------ build.gradle | 7 +++++-- settings.gradle | 2 +- .../org/itsallcode/jlua/FunctionCallException.java | 2 +- src/main/java/org/itsallcode/jlua/LowLevelLua.java | 11 ++++++----- src/main/java/org/itsallcode/jlua/LuaException.java | 2 +- src/main/java/org/itsallcode/jlua/LuaFunction.java | 4 ++-- .../java/org/itsallcode/jlua/LuaInterpreter.java | 2 +- src/main/java/org/itsallcode/jlua/LuaStack.java | 4 ++-- src/main/java/org/itsallcode/jlua/LuaTable.java | 4 ++-- src/main/java/org/itsallcode/jlua/LuaType.java | 4 ++-- .../java/org/itsallcode/jlua/LowLevelLuaTest.java | 2 +- .../java/org/itsallcode/jlua/LuaInterpreterTest.java | 6 ++---- src/test/java/org/itsallcode/jlua/LuaStackTest.java | 6 ++---- 15 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3994e27..bbf66ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,5 +27,9 @@ "search.exclude": { "build/generated/jextract": false, }, - "java.compile.nullAnalysis.mode": "automatic" + "java.compile.nullAnalysis.mode": "automatic", + "sonarlint.connectedMode.project": { + "connectionId": "kaklakariada-github", + "projectKey": "luava" + } } diff --git a/README.md b/README.md index 20c46e6..d0a4f71 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# java-lua +# luava An experimental Java library for embedding a Lua VM. [![Build](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml/badge.svg)](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jlua) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=bugs)](https://sonarcloud.io/summary/new_code?id=jlua) -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=jlua) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=coverage)](https://sonarcloud.io/summary/new_code?id=jlua) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=jlua&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=jlua) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=luava) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=bugs)](https://sonarcloud.io/summary/new_code?id=luava) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=luava) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=coverage)](https://sonarcloud.io/summary/new_code?id=luava) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=luava) ## Development diff --git a/build.gradle b/build.gradle index 38d458b..feffed2 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,9 @@ plugins { id "org.sonarqube" version "5.1.0.4882" } +version = '0.0.1' +group = 'org.itsallcode' + repositories { mavenCentral() } @@ -24,7 +27,7 @@ java { javadoc { enabled = true failOnError = true - excludes = ["org/itsallcode/jlua/ffi/**"] + excludes = ["org/itsallcode/luava/ffi/**"] options.addBooleanOption('html5', true) options.addStringOption('Xwerror', '-quiet') } @@ -138,7 +141,7 @@ task generateNativeInterface(type: Exec, dependsOn: [tasks.unpackJextract]) { commandLine jextractBinary, '--include-dir', includeDir, '--output', generatedSrc, - '--target-package', 'org.itsallcode.jlua.ffi', + '--target-package', 'org.itsallcode.luava.ffi', '--library', 'lua', '--header-class-name', 'Lua', "$includeDir/all_lua.h" diff --git a/settings.gradle b/settings.gradle index 790ab51..78f0cc3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,4 +3,4 @@ plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } -rootProject.name = 'jlua' +rootProject.name = 'luava' diff --git a/src/main/java/org/itsallcode/jlua/FunctionCallException.java b/src/main/java/org/itsallcode/jlua/FunctionCallException.java index a50c089..c1dd78c 100644 --- a/src/main/java/org/itsallcode/jlua/FunctionCallException.java +++ b/src/main/java/org/itsallcode/jlua/FunctionCallException.java @@ -1,4 +1,4 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; public class FunctionCallException extends LuaException { private static final long serialVersionUID = 1L; diff --git a/src/main/java/org/itsallcode/jlua/LowLevelLua.java b/src/main/java/org/itsallcode/jlua/LowLevelLua.java index 6432023..7e79d67 100644 --- a/src/main/java/org/itsallcode/jlua/LowLevelLua.java +++ b/src/main/java/org/itsallcode/jlua/LowLevelLua.java @@ -1,11 +1,11 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import org.itsallcode.jlua.ffi.Lua; -import org.itsallcode.jlua.ffi.lua_KFunction; -import org.itsallcode.jlua.ffi.lua_KFunction.Function; +import org.itsallcode.luava.ffi.Lua; +import org.itsallcode.luava.ffi.lua_KFunction; +import org.itsallcode.luava.ffi.lua_KFunction.Function; class LowLevelLua implements AutoCloseable { private final Arena arena; @@ -36,7 +36,8 @@ void pcall(final int nargs, final int nresults, final int errfunc, final long ct pcall(nargs, nresults, errfunc, ctx, function); } - void pcall(final int nargs, final int nresults, final int errfunc, final long ctx, final Function upcallFunction) { + void pcall(final int nargs, final int nresults, final int errfunc, final long ctx, + final lua_KFunction.Function upcallFunction) { final MemorySegment k = lua_KFunction.allocate(upcallFunction, arena); final int error = Lua.lua_pcallk(state, nargs, nresults, errfunc, ctx, k); if (error != 0) { diff --git a/src/main/java/org/itsallcode/jlua/LuaException.java b/src/main/java/org/itsallcode/jlua/LuaException.java index 5ceb874..65c1d7e 100644 --- a/src/main/java/org/itsallcode/jlua/LuaException.java +++ b/src/main/java/org/itsallcode/jlua/LuaException.java @@ -1,4 +1,4 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; public class LuaException extends RuntimeException { private static final long serialVersionUID = 1L; diff --git a/src/main/java/org/itsallcode/jlua/LuaFunction.java b/src/main/java/org/itsallcode/jlua/LuaFunction.java index 83e2dc7..30df166 100644 --- a/src/main/java/org/itsallcode/jlua/LuaFunction.java +++ b/src/main/java/org/itsallcode/jlua/LuaFunction.java @@ -1,9 +1,9 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import org.itsallcode.jlua.ffi.Lua; +import org.itsallcode.luava.ffi.Lua; public class LuaFunction { diff --git a/src/main/java/org/itsallcode/jlua/LuaInterpreter.java b/src/main/java/org/itsallcode/jlua/LuaInterpreter.java index 0631d0b..2d2476c 100644 --- a/src/main/java/org/itsallcode/jlua/LuaInterpreter.java +++ b/src/main/java/org/itsallcode/jlua/LuaInterpreter.java @@ -1,4 +1,4 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; public class LuaInterpreter implements AutoCloseable { diff --git a/src/main/java/org/itsallcode/jlua/LuaStack.java b/src/main/java/org/itsallcode/jlua/LuaStack.java index 057a8e7..04c9764 100644 --- a/src/main/java/org/itsallcode/jlua/LuaStack.java +++ b/src/main/java/org/itsallcode/jlua/LuaStack.java @@ -1,10 +1,10 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.charset.StandardCharsets; -import org.itsallcode.jlua.ffi.Lua; +import org.itsallcode.luava.ffi.Lua; class LuaStack { private final MemorySegment state; diff --git a/src/main/java/org/itsallcode/jlua/LuaTable.java b/src/main/java/org/itsallcode/jlua/LuaTable.java index 3beadfb..36ac9d1 100644 --- a/src/main/java/org/itsallcode/jlua/LuaTable.java +++ b/src/main/java/org/itsallcode/jlua/LuaTable.java @@ -1,9 +1,9 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import org.itsallcode.jlua.ffi.Lua; +import org.itsallcode.luava.ffi.Lua; public class LuaTable { private final LuaStack stack; diff --git a/src/main/java/org/itsallcode/jlua/LuaType.java b/src/main/java/org/itsallcode/jlua/LuaType.java index 92cbaec..323007f 100644 --- a/src/main/java/org/itsallcode/jlua/LuaType.java +++ b/src/main/java/org/itsallcode/jlua/LuaType.java @@ -1,8 +1,8 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import java.util.Arrays; -import org.itsallcode.jlua.ffi.Lua; +import org.itsallcode.luava.ffi.Lua; public enum LuaType { NONE(Lua.LUA_TNONE()), NIL(Lua.LUA_TNIL()), BOOLEAN(Lua.LUA_TBOOLEAN()), LIGHT_USERDATA(Lua.LUA_TLIGHTUSERDATA()), diff --git a/src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java b/src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java index feae151..e31a2f7 100644 --- a/src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java +++ b/src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java @@ -1,4 +1,4 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java b/src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java index cc684c8..25ccfa9 100644 --- a/src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java +++ b/src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java @@ -1,13 +1,11 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import org.junit.jupiter.api.function.Executable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/src/test/java/org/itsallcode/jlua/LuaStackTest.java b/src/test/java/org/itsallcode/jlua/LuaStackTest.java index 93b78b9..01aece4 100644 --- a/src/test/java/org/itsallcode/jlua/LuaStackTest.java +++ b/src/test/java/org/itsallcode/jlua/LuaStackTest.java @@ -1,11 +1,9 @@ -package org.itsallcode.jlua; +package org.itsallcode.luava; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; From 39dc7e2ae63893e232ce2a82d34084f39c927efe Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sun, 22 Sep 2024 10:42:19 +0200 Subject: [PATCH 3/5] Move files to correct package --- .../org/itsallcode/{jlua => luava}/FunctionCallException.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LowLevelLua.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaException.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaFunction.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaInterpreter.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaStack.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaTable.java | 0 src/main/java/org/itsallcode/{jlua => luava}/LuaType.java | 0 .../java/org/itsallcode/{jlua => luava}/LowLevelLuaTest.java | 0 .../java/org/itsallcode/{jlua => luava}/LuaInterpreterTest.java | 0 src/test/java/org/itsallcode/{jlua => luava}/LuaStackTest.java | 1 + 11 files changed, 1 insertion(+) rename src/main/java/org/itsallcode/{jlua => luava}/FunctionCallException.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LowLevelLua.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaException.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaFunction.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaInterpreter.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaStack.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaTable.java (100%) rename src/main/java/org/itsallcode/{jlua => luava}/LuaType.java (100%) rename src/test/java/org/itsallcode/{jlua => luava}/LowLevelLuaTest.java (100%) rename src/test/java/org/itsallcode/{jlua => luava}/LuaInterpreterTest.java (100%) rename src/test/java/org/itsallcode/{jlua => luava}/LuaStackTest.java (97%) diff --git a/src/main/java/org/itsallcode/jlua/FunctionCallException.java b/src/main/java/org/itsallcode/luava/FunctionCallException.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/FunctionCallException.java rename to src/main/java/org/itsallcode/luava/FunctionCallException.java diff --git a/src/main/java/org/itsallcode/jlua/LowLevelLua.java b/src/main/java/org/itsallcode/luava/LowLevelLua.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LowLevelLua.java rename to src/main/java/org/itsallcode/luava/LowLevelLua.java diff --git a/src/main/java/org/itsallcode/jlua/LuaException.java b/src/main/java/org/itsallcode/luava/LuaException.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaException.java rename to src/main/java/org/itsallcode/luava/LuaException.java diff --git a/src/main/java/org/itsallcode/jlua/LuaFunction.java b/src/main/java/org/itsallcode/luava/LuaFunction.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaFunction.java rename to src/main/java/org/itsallcode/luava/LuaFunction.java diff --git a/src/main/java/org/itsallcode/jlua/LuaInterpreter.java b/src/main/java/org/itsallcode/luava/LuaInterpreter.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaInterpreter.java rename to src/main/java/org/itsallcode/luava/LuaInterpreter.java diff --git a/src/main/java/org/itsallcode/jlua/LuaStack.java b/src/main/java/org/itsallcode/luava/LuaStack.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaStack.java rename to src/main/java/org/itsallcode/luava/LuaStack.java diff --git a/src/main/java/org/itsallcode/jlua/LuaTable.java b/src/main/java/org/itsallcode/luava/LuaTable.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaTable.java rename to src/main/java/org/itsallcode/luava/LuaTable.java diff --git a/src/main/java/org/itsallcode/jlua/LuaType.java b/src/main/java/org/itsallcode/luava/LuaType.java similarity index 100% rename from src/main/java/org/itsallcode/jlua/LuaType.java rename to src/main/java/org/itsallcode/luava/LuaType.java diff --git a/src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java b/src/test/java/org/itsallcode/luava/LowLevelLuaTest.java similarity index 100% rename from src/test/java/org/itsallcode/jlua/LowLevelLuaTest.java rename to src/test/java/org/itsallcode/luava/LowLevelLuaTest.java diff --git a/src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java b/src/test/java/org/itsallcode/luava/LuaInterpreterTest.java similarity index 100% rename from src/test/java/org/itsallcode/jlua/LuaInterpreterTest.java rename to src/test/java/org/itsallcode/luava/LuaInterpreterTest.java diff --git a/src/test/java/org/itsallcode/jlua/LuaStackTest.java b/src/test/java/org/itsallcode/luava/LuaStackTest.java similarity index 97% rename from src/test/java/org/itsallcode/jlua/LuaStackTest.java rename to src/test/java/org/itsallcode/luava/LuaStackTest.java index 01aece4..f2219c1 100644 --- a/src/test/java/org/itsallcode/jlua/LuaStackTest.java +++ b/src/test/java/org/itsallcode/luava/LuaStackTest.java @@ -3,6 +3,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; +import org.itsallcode.luava.LuaType; import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; From 355aac6c4940683c95632e4b68622256154e3fdc Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sun, 22 Sep 2024 10:44:48 +0200 Subject: [PATCH 4/5] Update badges --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d0a4f71..7b51097 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,17 @@ An experimental Java library for embedding a Lua VM. [![Build](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml/badge.svg)](https://github.com/kaklakariada/java-lua/actions/workflows/build.yml) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=luava) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=bugs)](https://sonarcloud.io/summary/new_code?id=luava) -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=luava) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=coverage)](https://sonarcloud.io/summary/new_code?id=luava) -[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=luava&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=luava) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=bugs)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=coverage)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=org.itsallcode%3Aluava&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=org.itsallcode%3Aluava) ## Development From 3fe72a8e7e32104ace3afbe2d1b958c4bc43d5e2 Mon Sep 17 00:00:00 2001 From: kaklakariada Date: Sun, 22 Sep 2024 10:46:15 +0200 Subject: [PATCH 5/5] Fix sonar findings --- .../org/itsallcode/luava/LowLevelLua.java | 1 - .../org/itsallcode/luava/LowLevelLuaTest.java | 20 ------------------- .../org/itsallcode/luava/LuaStackTest.java | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 src/test/java/org/itsallcode/luava/LowLevelLuaTest.java diff --git a/src/main/java/org/itsallcode/luava/LowLevelLua.java b/src/main/java/org/itsallcode/luava/LowLevelLua.java index 7e79d67..0c6ab05 100644 --- a/src/main/java/org/itsallcode/luava/LowLevelLua.java +++ b/src/main/java/org/itsallcode/luava/LowLevelLua.java @@ -30,7 +30,6 @@ void openLibs() { void pcall(final int nargs, final int nresults, final int errfunc, final long ctx) { final Function function = (final MemorySegment l, final int status, final long ctx1) -> { - System.out.println("Upcall callback"); return 0; }; pcall(nargs, nresults, errfunc, ctx, function); diff --git a/src/test/java/org/itsallcode/luava/LowLevelLuaTest.java b/src/test/java/org/itsallcode/luava/LowLevelLuaTest.java deleted file mode 100644 index e31a2f7..0000000 --- a/src/test/java/org/itsallcode/luava/LowLevelLuaTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.itsallcode.luava; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; - -class LowLevelLuaTest { - private LowLevelLua lua; - - @BeforeEach - void setup() { - lua = LowLevelLua.create(); - } - - @AfterEach - void stop() { - lua.close(); - } - - -} diff --git a/src/test/java/org/itsallcode/luava/LuaStackTest.java b/src/test/java/org/itsallcode/luava/LuaStackTest.java index f2219c1..112673c 100644 --- a/src/test/java/org/itsallcode/luava/LuaStackTest.java +++ b/src/test/java/org/itsallcode/luava/LuaStackTest.java @@ -3,11 +3,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import org.itsallcode.luava.LuaType; import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; + class LuaStackTest { private LowLevelLua lua; private LuaStack stack;