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

Suggestions to improve fmt-project #962

Open
nezuo opened this issue Aug 17, 2024 · 1 comment
Open

Suggestions to improve fmt-project #962

nezuo opened this issue Aug 17, 2024 · 1 comment
Labels
scope: cli Relevant to the Rojo CLI type: enhancement Feature or improvement that should potentially happen

Comments

@nezuo
Copy link
Contributor

nezuo commented Aug 17, 2024

  1. Add fmt-project --check so formatting can be checked in CI.
  2. Description: what are "the standard JSON formatting rules"?
    image
  3. Make fmt-project deterministic. Currently, it reorders properties every time you run it.
  4. Make certain data types more concise:
  • For example, Vector3 is formatted as:
"Position": [
  0.0,
  -10.0,
  0.0
]

but is should be formatted as:

"Position": [0.0, -10.0, 0.0]
  1. 2 spaces is a bit hard to read for me but I don't necessarily think that should change.
  2. Instance/project settings (anything that starts with $, for example $properties) should come before child instances.
@Dekkonot
Copy link
Member

With regards to point 3, this is something that's already being done with Syncback. The main issue right now is that project files (as well as all the other JSON formats) use HashMaps for things, which are obviously unordered. Since syncback needs to be deterministic, it had to solve this problem and when it's merged the ordering will be guaranteed.

Point 4 isn't feasible, unfortunately, since it'd involve us using something other than for serializing Variant. I'm not willing to commit to that because of the complexity it'd bring to the table.

Otherwise, I think these are reasonable! fmt-project has gone basically untouched since it was introduced and these suggestions would be great improvements to it.

@Dekkonot Dekkonot added type: enhancement Feature or improvement that should potentially happen scope: cli Relevant to the Rojo CLI labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: cli Relevant to the Rojo CLI type: enhancement Feature or improvement that should potentially happen
Projects
None yet
Development

No branches or pull requests

2 participants