Use packaged config.yml as default and stop rewriting config on startup #1

Merged
NotAlexNoyle merged 1 commits from codex/update-plugin-to-use-custom-config-file into master 2026-02-18 05:48:08 -05:00
NotAlexNoyle commented 2026-02-18 05:45:46 -05:00 (Migrated from github.com)

Motivation

  • Prevent the plugin from overwriting the shipped src/main/resources/config.yml at startup or reload and instead use the bundled file as the default configuration.

Description

  • Call saveDefaultConfig() in PurpurConfig so the packaged config.yml is installed only when no config exists.
  • Remove the previous direct-file save logic and related logger/code from PurpurConfig, eliminating custom writes to config.yml.
  • Remove config.saveConfig() calls from onEnable() and the reload flow in PurpurExtrasOG so startup/reload no longer rewrite configuration values.
  • Remove unused imports/fields introduced by the deleted save logic.

Testing

  • Ran ./gradlew test and ./gradlew compileJava, which failed in this environment due to a Kotlin/Gradle tooling error parsing the system Java version (25.0.1). (failure)
  • Re-ran ./gradlew test with JAVA_HOME set to Java 21 (JAVA_HOME=$HOME/.local/share/mise/installs/java/21.0.2 PATH=$JAVA_HOME/bin:$PATH ./gradlew test), which failed due to plugin resolution for com.diffplug.spotless in this environment. (failure)

Codex Task

### Motivation - Prevent the plugin from overwriting the shipped `src/main/resources/config.yml` at startup or reload and instead use the bundled file as the default configuration. ### Description - Call `saveDefaultConfig()` in `PurpurConfig` so the packaged `config.yml` is installed only when no config exists. - Remove the previous direct-file save logic and related logger/code from `PurpurConfig`, eliminating custom writes to `config.yml`. - Remove `config.saveConfig()` calls from `onEnable()` and the reload flow in `PurpurExtrasOG` so startup/reload no longer rewrite configuration values. - Remove unused imports/fields introduced by the deleted save logic. ### Testing - Ran `./gradlew test` and `./gradlew compileJava`, which failed in this environment due to a Kotlin/Gradle tooling error parsing the system Java version (`25.0.1`). (failure) - Re-ran `./gradlew test` with `JAVA_HOME` set to Java 21 (`JAVA_HOME=$HOME/.local/share/mise/installs/java/21.0.2 PATH=$JAVA_HOME/bin:$PATH ./gradlew test`), which failed due to plugin resolution for `com.diffplug.spotless` in this environment. (failure) ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69954247ccec832f8f6fbe8edb10df66)
Sign in to join this conversation.