Skip to content

handle spaces between keywords #627

Closed

Description

@fdiblen
          if user provides spaces between keywords, those will be appended to the keyword like so: `keywords = ["kw1"," kw2"]` We need to strip it or validate.

Originally posted by @lyashevska in #624 (comment)

Activity

  1. changed the title [-]handles spaces between keywords[/-] [+]handle spaces between keywords[/+] on Aug 28, 2024
  2. simonvanlierde commented on Oct 26, 2026

    @simonvanlierde
    Contributor

    Hi,

    I can reproduce this on main. The keywords answer is split on , and not trimmed, so kw1, second kw gives keywords = ["kw1"," second kw"], and an empty answer gives keywords = [""]. The CITATION.cff template has the same loop, and an empty answer writes a keywords: list with one empty entry.

    What I'd change:

    • trim each keyword and drop empty ones, in both pyproject.toml.jinja and the CITATION.cff template
    • leave keywords: out of CITATION.cff when nothing is left, and write keywords = [] in pyproject.toml
    • two tests in tests/test_values.py that fail on main and pass with the change, plus a CHANGELOG line
      Would you welcome a PR for this? I have it ready.

    Simon

  3. sjvrijn commented on Oct 26, 2026

    @sjvrijn
    Contributor

    @simonvanlierde yes, a PR would be very welcome!

  4. sjvrijn commented on Oct 28, 2026

    @sjvrijn
    Contributor

    Closed by #715

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions