Skip to content

Commit

Permalink
Merge branch 'beta' into CakeTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidArthurCole authored Oct 13, 2024
2 parents cc4ed31 + c31bef7 commit 4af491f
Show file tree
Hide file tree
Showing 280 changed files with 3,635 additions and 2,230 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
- uses: ./.github/actions/setup-normal-workspace
- name: Build with Gradle
run: ./gradlew assemble -x test --stacktrace
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload development build
with:
name: "Development Build"
path: build/libs/*.jar
- name: Test with Gradle
run: ./gradlew test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: "Upload test report"
if: ${{ !cancelled() }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Generate Repo Patterns using Gradle
run: |
./gradlew generateRepoPatterns --stacktrace
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload generated repo regexes
with:
name: Repo Regexes
Expand All @@ -45,7 +45,7 @@ jobs:
with:
repository: ${{ env.data_repo }}
branch: main
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Upload generated repo regexes
with:
name: Repo Regexes
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "PR Changelog Verification"

on:
pull_request_target:
types: [ opened, edited ]

jobs:
verify-changelog:
if: github.event.pull_request.state == 'open' && '511310721' == github.repository_id
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: ./.github/actions/setup-normal-workspace

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run ChangeLog verification
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
./gradlew checkPrDescription -PprTitle="${PR_TITLE}" -PprBody="${PR_BODY}"
- name: Add label if changelog verification fails
if: failure()
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'Wrong Title/Changelog'

- name: Remove label if changelog verification passes
if: success()
uses: actions-ecosystem/action-remove-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'Wrong Title/Changelog'

- name: Add comment to PR if changelog verification fails
if: failure()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const test = fs.readFileSync('versions/1.8.9/build/changelog_errors.txt', 'utf8');
const commentBody = `${test}`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
})
3 changes: 2 additions & 1 deletion .idea/dictionaries/default_user.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .live-plugins/module/plugin.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ val forgeEvent = "SubscribeEvent"
val handleEvent = "HandleEvent"
val skyHanniModule = "SkyHanniModule"

val skyhanniPath = "at.hannibal2.skyhanni"
val patternGroup = "at.hannibal2.skyhanni.utils.repopatterns.RepoPatternGroup"
val pattern = "java.util.regex.Pattern"

Expand All @@ -36,12 +37,17 @@ fun isRepoPattern(property: KtProperty): Boolean {
return false
}

fun isFromSkyhanni(declaration: KtNamedDeclaration): Boolean {
return declaration.fqName?.asString()?.startsWith(skyhanniPath) ?: false
}

class ModuleInspectionKotlin : AbstractKotlinInspection() {
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor {

val visitor = object : KtVisitorVoid() {

override fun visitClass(klass: KtClass) {
if (!isFromSkyhanni(klass)) return
val hasAnnotation = klass.annotationEntries.any { it.shortName?.asString() == skyHanniModule }

if (hasAnnotation) {
Expand All @@ -54,6 +60,7 @@ class ModuleInspectionKotlin : AbstractKotlinInspection() {
}

override fun visitObjectDeclaration(declaration: KtObjectDeclaration) {
if (!isFromSkyhanni(declaration)) return
val hasAnnotation = declaration.annotationEntries.any { it.shortName?.asString() == skyHanniModule }
if (hasAnnotation) return

Expand Down
12 changes: 10 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import at.skyhanni.sharedvariables.MultiVersionStage
import at.skyhanni.sharedvariables.ProjectTarget
import at.skyhanni.sharedvariables.SHVersionInfo
import at.skyhanni.sharedvariables.versionString
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import net.fabricmc.loom.task.RunGameTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import skyhannibuildsystem.ChangelogVerification

plugins {
idea
Expand Down Expand Up @@ -102,6 +103,13 @@ tasks.runClient {
},
)
}

tasks.register("checkPrDescription", ChangelogVerification::class) {
this.outputDirectory.set(layout.buildDirectory)
this.prTitle = project.findProperty("prTitle") as String
this.prBody = project.findProperty("prBody") as String
}

val shot = shots.shot("minecraft", rootProject.file("shots.txt"))

dependencies {
Expand Down
17 changes: 17 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
maven("https://jitpack.io") {
content {
includeGroupByRegex("com\\.github\\..*")
}
}
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("com.github.SkyHanniStudios:SkyHanniChangelogBuilder:1.0.1")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package skyhannibuildsystem

import at.hannibal2.changelog.SkyHanniChangelogBuilder
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import java.io.File

abstract class ChangelogVerification : DefaultTask() {

@get:OutputDirectory
abstract val outputDirectory: DirectoryProperty

@Input
var prTitle: String = ""

@Input
var prBody: String = ""

@get:Internal
val prBodyLines get() = prBody.lines()

private val prLink = "ignored"
private val templateLocation = "https://github.com/hannibal002/SkyHanni/blob/beta/pull_request_template.md"

@TaskAction
fun scanChangelog() {
if (prBodyLines.contains("exclude_from_changelog")) {
println("PR is excluded from changelog verification")
return
}

val (changes, bodyErrors) = SkyHanniChangelogBuilder.findChanges(prBodyLines, prLink)
val titleErrors = SkyHanniChangelogBuilder.findPullRequestNameErrors(prTitle, changes)

if (bodyErrors.isEmpty() && titleErrors.isEmpty()) {
println("Changelog and title verification successful")
} else {
bodyErrors.forEach { println(it.message) }
titleErrors.forEach { println(it.message) }

// Export errors so that they can be listed in the PR comment
val errorFile = File(outputDirectory.get().asFile, "changelog_errors.txt")
println("saved error file to: ${errorFile.path}")

errorFile.appendText("I have detected some issues with your pull request:\n\n")

if (bodyErrors.isNotEmpty()) {
errorFile.appendText("Body issues:\n${bodyErrors.joinToString("\n") { it.formatLine() }}\n\n")
}
if (titleErrors.isNotEmpty()) {
errorFile.appendText("Title issues:\n${titleErrors.joinToString("\n") { it.message }}\n\n")
}

errorFile.appendText("Please fix these issues. For the correct format, refer to the [pull request template]($templateLocation).")

throw GradleException("Changelog verification failed")
}
}
}
45 changes: 45 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
+ Added Focus Mode. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/2694)
+ In Focus Mode, only the name of the item is displayed instead of the full description.

#### Fishing Features

+ Added Lava Replacement. - HiZe (https://github.com/hannibal002/SkyHanni/pull/1885)
+ Replaces the lava texture with the water texture.
+ Primarily used for lava fishing in the Crimson Isle, but can be used anywhere else if the option is enabled.

#### Mining Features

+ Added Precision Mining Highlighter. - Cuz_Im_Clicks (https://github.com/hannibal002/SkyHanni/pull/2614)
+ Draws a box over the Precision Mining particles.
+ Added highlighting boxes to Crystal Nucleus crystals during Hoppity's Hunt. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2598)

### Improvements

#### Inventory Improvements
Expand All @@ -27,8 +39,20 @@
+ Added support for Guilds in player-related tab completions. - ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/2637)
+ Added support for all Guild and Friend commands in tab completions. - ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/2637)

#### Combat Improvements

+ Added Totem of Corruption and Enrager to the Ability Cooldown feature. - DungeonHub (https://github.com/hannibal002/SkyHanni/pull/2706)

#### Misc Improvements

+ Added distance display to waypoints created by Patcher's Send Coords feature. - jani (https://github.com/hannibal002/SkyHanni/pull/2704)

### Fixes

#### Dungeon Fixes

+ Fixed Magical Power resetting to 0 when opening "Your Bags" in the Catacombs. - j10a1n15 (https://github.com/hannibal002/SkyHanni/pull/2710)

#### Fishing Fixes

+ Fixed fishing displays showing in dungeons. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2697)
Expand All @@ -37,18 +61,39 @@

+ Fixed "No Guardian Pet warning" not supporting Pet Rule "On open Experimentation Table". - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2699)
+ Fixed an error with compact experiment rewards chat messages. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2702)
+ Fixed Craft Materials Bazaar not working with long item names. - Fazfoxy (https://github.com/hannibal002/SkyHanni/pull/2703)
+ Fixed the debug feature that allows you to add/remove stars being enabled by default. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2715)

#### Combat Fixes

+ Fixed Ghost Counter display appearing while in incorrect areas on the map. - hannibal2 (https://github.com/hannibal002/SkyHanni/pull/2696)

#### Custom Scoreboard Fixes

+ Fixed Custom Scoreboard not showing the Second Barbarian Quest. - j10a1n15 (https://github.com/hannibal002/SkyHanni/pull/2709)

#### Hoppity Fixes

+ Fixed the chocolate egg share message sometimes displaying the wrong location name. - martimavocado (https://github.com/hannibal002/SkyHanni/pull/2711)

#### Commands Fixes

+ Fixed /shtranslate not working in most cases. - Obsidian (https://github.com/hannibal002/SkyHanni/pull/2693)

### Technical Details

+ Assigned 'backend' label to PRs with 'backend' in the title. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2690)
+ This does not change the functionality of the current bug fix label.
+ Added SuggestionProvider. - ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/2637)
+ This new class simplifies building suggestion trees.
+ Added Stats API. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/2253)
+ Cleaned up LorenzVec and added drawLineToEye. - Empa (https://github.com/hannibal002/SkyHanni/pull/2056)
+ Added SkyHanni event inheritance. - ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/2047)
+ Added /shtranslateadvanced command. - Obsidian (https://github.com/hannibal002/SkyHanni/pull/2693)
+ Allows specifying both the source and target language.
+ Added changelog verification. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/2692)
+ This action ensures your PR is in the correct format so that it can be used by the release notes tool.
+ Added dungeon phase detection. - martimavocado (https://github.com/hannibal002/SkyHanni/pull/1865)

## Version 0.27

Expand Down
6 changes: 6 additions & 0 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ Added an alert for Gold or Diamond Trophy Fish catches. - ReyMaratov (https://github.com/hannibal002/SkyHanni/pull/2615)
+ Displays a popup with the trophy name, rarity, and amount of the catch.
+ Optionally, also plays a sound.
+ Added Lava Replacement. - HiZe (https://github.com/hannibal002/SkyHanni/pull/1885)
+ Replaces the lava texture with the water texture.
+ Primarily used for lava fishing in the Crimson Isle, but can be used anywhere else if the option is enabled.

</details>
<details open><summary>
Expand Down Expand Up @@ -911,6 +914,9 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ Added a "Get from Sack" button in the forge recipe menu to retrieve ingredients. - minhperry (https://github.com/hannibal002/SkyHanni/pull/2106)
+ Added Tracker for Glacite Corpses. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2306)
+ Tracks overall loot and loot per type.
+ Added Precision Mining Highlighter. - Cuz_Im_Clicks (https://github.com/hannibal002/SkyHanni/pull/2614)
+ Draws a box over the Precision Mining particles.
+ Added highlighting boxes to Crystal Nucleus crystals during Hoppity's Hunt. - Daveed (https://github.com/hannibal002/SkyHanni/pull/2598)

</details>
<details open><summary>
Expand Down
2 changes: 1 addition & 1 deletion root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {

allprojects {
group = "at.hannibal2.skyhanni"
version = "0.28.Beta.1"
version = "0.28.Beta.2"
repositories {
mavenCentral()
mavenLocal()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigFileType
import at.hannibal2.skyhanni.config.ConfigManager
import at.hannibal2.skyhanni.config.Features
import at.hannibal2.skyhanni.config.SackData
import at.hannibal2.skyhanni.config.commands.Commands
import at.hannibal2.skyhanni.config.commands.RegisterCommandsEvent
import at.hannibal2.skyhanni.data.OtherInventoryData
import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
Expand Down Expand Up @@ -59,7 +59,7 @@ class SkyHanniMod {

SkyHanniEvents.init(modules)

Commands.init()
RegisterCommandsEvent.post()

PreInitFinishedEvent().post()
}
Expand Down
Loading

0 comments on commit 4af491f

Please sign in to comment.