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

automatic formatting for json files #882

Open
5 tasks
bpkroth opened this issue Nov 14, 2024 · 2 comments
Open
5 tasks

automatic formatting for json files #882

bpkroth opened this issue Nov 14, 2024 · 2 comments
Labels
help wanted Extra attention is needed low priority Low-priority issue

Comments

@bpkroth
Copy link
Contributor

bpkroth commented Nov 14, 2024

  • Add Makefile format target rules to reformat *.json and *.jsonc files.
  • Add Makefile check target rules to check the format of json files.
  • Add pre-commit config hooks using either prettier or pretty-format-json
  • Require those rules and reformat json files.
@bpkroth bpkroth added the help wanted Extra attention is needed label Nov 22, 2024
@bpkroth
Copy link
Contributor Author

bpkroth commented Jan 4, 2025

Could also make use of pretty-format-json hook in our new .pre-commit-config.yaml.

See: #904

@bpkroth bpkroth mentioned this issue Jan 13, 2025
4 tasks
@bpkroth
Copy link
Contributor Author

bpkroth commented Jan 13, 2025

I played with this a little bit in #930, but all the tools I've found so far currently strip the comments from the jsonc files which I don't think we want.

@bpkroth bpkroth changed the title prettier formatting for json files automatic formatting for json files Jan 17, 2025
@bpkroth bpkroth added the low priority Low-priority issue label Jan 17, 2025
bpkroth added a commit that referenced this issue Jan 17, 2025
# Pull Request

## Title

Json Checking

______________________________________________________________________

## Description

Add pre-commit hooks to check ~and format~ json/json5.

- [x] remove prettier config
- [x] check json5 files
- [ ] ~preserve comments when formatting~
- [ ] ~rename mlos_bench config files to `*.mlos.jsonc`~

______________________________________________________________________

## Type of Change

- ✨ New feature

______________________________________________________________________

## Additional Comments

See #882 for comments regarding the difficulty in auto-formatting
jsonc/json5 while also preserving comments.
We leave this for future work.

______________________________________________________________________
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed low priority Low-priority issue
Projects
None yet
Development

No branches or pull requests

1 participant