Skip to content

feat: warn on unknown config keys - #1613

Open
syu-toutousai wants to merge 1 commit into
floatpane:masterfrom
syu-toutousai:master
Open

feat: warn on unknown config keys#1613
syu-toutousai wants to merge 1 commit into
floatpane:masterfrom
syu-toutousai:master

Conversation

@syu-toutousai

@syu-toutousai syu-toutousai commented Jun 23, 2026

Copy link
Copy Markdown

What?

Emit a warning at startup when the config file contains keys that the application does not recognize.

  • Added warnUnknownConfigKeys function that decodes top-level JSON keys and logs warnings for unknown ones
  • Parses only top-level keys using json.RawMessage to keep startup overhead negligible

Why?

Typos or leftover/stale config keys currently fail silently. Surfacing them at startup helps users catch mistakes before wasting time debugging unexpected behavior.

@syu-toutousai
syu-toutousai requested a review from a team as a code owner June 23, 2026 01:23
@floatpanebot floatpanebot added the area/config Configuration / settings label Jun 23, 2026

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @syu-toutousai! Please fix the following issues with your PR:

  • Title: Does not follow conventional commits (e.g., feat: added something, fix(core): resolved crash).
  • Title: Is too long (41 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added bug Something isn't working size/M Diff: 51–200 lines labels Jun 23, 2026
@andrinoff

Copy link
Copy Markdown
Member

AI

@andrinoff andrinoff closed this Jun 23, 2026

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrinoff! Please fix the following issues with your PR:

  • Title: Does not follow conventional commits (e.g., feat: added something, fix(core): resolved crash).
  • Title: Is too long (41 characters). The PR title must be strictly under 40 characters.
  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@andrinoff andrinoff reopened this Jun 23, 2026
@syu-toutousai syu-toutousai changed the title FEAT: Warn on unknown keys in config file feat: warn on unknown config keys Jun 26, 2026
@floatpanebot floatpanebot added the enhancement New feature or request label Jun 26, 2026
@floatpanebot
floatpanebot dismissed stale reviews from themself June 26, 2026 05:14

Formatting issues have been resolved. Thank you!

@syu-toutousai

Copy link
Copy Markdown
Author

Hi @andrinoff — thanks for taking a look. Happy to explain the implementation or make any changes you'd like to see. The approach uses json.RawMessage to decode only top-level keys without deep-parsing the full config tree, so there's no performance regression at startup. Let me know if there's a specific style or pattern you'd prefer for the warning output.

@floatpanebot floatpanebot added the stale No activity for extended period label Aug 12, 2026
@floatpanebot

Copy link
Copy Markdown
Member

This has had no activity for 45 days. It will be closed in 21 days unless updated. Comment or remove the stale label to keep it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Configuration / settings bug Something isn't working enhancement New feature or request size/M Diff: 51–200 lines stale No activity for extended period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants