Skip to content

feat: add custom label support via *_label config options#37

Merged
attilarepka merged 8 commits into
attilarepka:masterfrom
gbomacfly:feature/custom-labels
May 24, 2026
Merged

feat: add custom label support via *_label config options#37
attilarepka merged 8 commits into
attilarepka:masterfrom
gbomacfly:feature/custom-labels

Conversation

@gbomacfly

Copy link
Copy Markdown
Contributor

feat: add custom label support via *_label config options

Closes #33

What does this PR do?

Adds optional *_label config options that allow users to override the default label text for each header field.

Changes

  • config.lua: new *_label options added to defaults, new get_label() helper function
  • core.lua: all header fields now use get_label() instead of constants directly
  • README.md: new section documenting the *_label options, defaults table updated
  • tests/header/setup_spec.lua: new label defaults added to expected config
  • tests/header/add_headers_spec.lua: new test case for custom labels

Usage

require("header").setup({
    file_name_label = "File:",
    author_label = "Author:",
    project_label = "Project:",
    date_created_label = "Created:",
    date_modified_label = "Modified:",
})

Notes

  • Default is nil for all *_label options → fully backwards compatible, no breaking change
  • When nil, the built-in label from constants is used as before

@gbomacfly gbomacfly force-pushed the feature/custom-labels branch from 0b3a8f4 to f58b51b Compare May 23, 2026 10:32
Comment thread lua/header/config.lua
@gbomacfly

Copy link
Copy Markdown
Contributor Author

First time contributing via PRs — I think it's working now ;)

@attilarepka

Copy link
Copy Markdown
Owner

Thanks!

@attilarepka attilarepka merged commit 9d0d24c into attilarepka:master May 24, 2026
3 checks passed
@gbomacfly gbomacfly deleted the feature/custom-labels branch May 24, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add config options to customize header field names

2 participants