Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Descriptions to keyboard.jsonschema #24594

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Buckwich
Copy link
Contributor

@Buckwich Buckwich commented Nov 11, 2024

Description

My main goal was to add the descriptions from the docs/reference_info_json.md to the data/schemas/keyboard.jsonschema while doing so I had some issues because the schemas didn't follow standard json syntax and I didn't want to use something like hjson for a machine readable schema. So I adjusted the schemas a bit to follow the standard (removed/added commas, converted comments to $comment fields)

I would also suggest to rename those files to *.schema.json and define a default format for them to make it easier to work with across multiple tools. Let me know what you think and I can do that in a seperate PR also adjusting the CLI tools that rely on these files.

For easier review I have split the json fixes, formatting, and adding of data in multiple commits

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python: I couldn't figure out which format was used for json so I used prettier
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the dd Data Driven Changes label Nov 11, 2024
@lesshonor
Copy link
Contributor

I think there is a lot of value in embedding descriptions into the schema which are presumably intended for some kind of "help end-users write firmware" tooling...to the point I assume such an initiative was already on the to-do list.

  • Nowhere near my call, but I don't know how much traction you will get converting these files from hjson to json at this point in time.
  • prettier is making some genuinely awful choices, IMO. These single-digit lines in the dip_switch.matrix_grid example are just rank:
    "examples": [
    [
    [
    0,
    6
    ],
    [
    1,
    6
    ],
    [
    2,
    6
    ]
    ]
    ]
    },

    ...being explicitly called out as an example, these contents need to remain easily parsed by humans.

@Buckwich
Copy link
Contributor Author

I tried to condense it a bit, but the format is already a bit inconsistent so there were some changes. the concrete example now looks like this:

[
  [0, 0],
  [0, 1],
  [4, 3]
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dd Data Driven Changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants