-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/#13 transform java to kotlin #17
Conversation
DivineThreepwood
commented
Jan 23, 2024
- transform java to kotlin
- link against latest jul version
- setup github action pipeline
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
@@ -130,3 +134,18 @@ | |||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true) | |||
} | |||
} | |||
kotlin { | |||
jvmToolchain(17) |
Check warning
Code scanning / detekt
Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers. Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swat-Teams don't seem to work and affect all agents instead.
Reproduction steps:
- Create Rule
"Wall Collision" swat COMMANDER inCase {agent.isCollisionDetected} then {agent.turnRandom()}
- See that all agents avoid the wall
Edit:
This was further tested using the following rule and teams:
"Wall Collisions" swat [team noted below] inCase {agent.isCollisionDetected} then {agent.turnRandom()}
COMMANDER
affects allNOT_COMMANDER
affects allBRAVO
affects allNOT_BRAVO
affects all
Additionally, "Wall Collisions" commander inCase {agent.isCollisionDetected} then {agent.turnRandom()}
affects all too.
It must be noted that the old-styled rule creation behaves differently:
createRule(object: Rule("Wall Collision old", [team noted below]){
override fun constraint(): Boolean {
return agent.isCollisionDetected
}
override fun action() {
agent.turnRandom()
}
})
COMMANDER
affects commander onlyNOT_COMMANDER
affects allBRAVO
affects Bravo onlyNOT_BRAVO
affects all
For all tests SwatTeam BRAVO was configured using:
override fun loadSwatTeams() {
createSwat(BRAVO, 1,2)
}
Thanks for the detailed error description. Since the new Kotlin DSL is just one optional Feature and not fully related to the java -> kotlin transformation I would go for handling that by a dedicated bug ticket: https://github.com/openbase/planetsudo/issues/18 if this is fine for you. |