sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Make storage of static data consistent

Open vcokltfre opened this issue 4 years ago • 3 comments

Description

Currently, the vast majority of static data stored in lance is in JSON format, but a few files are YAML or plain text. I propose that this all be turned into one format (JSON, and while I'm there make the JSON formatting consistent across all JSON files) so all static data is stored consistently.

Reasoning

This is a QoL improvement to make the bot more consistent, akin to the spring cleanup but without the huge amount of effort reviewing that took, instead this would be 2 commits:

  • Turning the non-JSON files to JSON and implementing the code changes to reflect that
  • Formatting each JSON file under bot/resources using Prettier

Would you like to implement this yourself?

  • [x] I'd like to implement this feature myself
  • [ ] Anyone can implement this feature

vcokltfre avatar May 16 '21 23:05 vcokltfre

Why JSON instead of YAML?

Xithrius avatar Sep 06 '21 19:09 Xithrius

I'd argue we would be better off switching everything to Yaml or Toml as it is much more readable :P but I'm not even sure that is worth doing

Akarys42 avatar Sep 06 '21 19:09 Akarys42

In our resources folder we have 3 yaml/toml files (https://github.com/search?q=repo%3Apython-discord%2Fsir-lancebot+extension%3Ayaml+extension%3Atoml+path%3Abot%2Fresources) and 43 json files (https://github.com/search?q=repo%3Apython-discord%2Fsir-lancebot+extension%3Ajson+path%3Abot%2Fresources), so a change to all JSON would be much easier.

I prefer JSON for this sort of use case, as it's more similar to Python's syntax so it's more clear how it will translate into a Python object once json.loaded, and i'd say people are probably more likely to be familiar with JSON than yaml/toml.

That said, my opinion on whether this should actually be done isn't too strong either way, if somebody wants to do it I'd be fine with that though.

wookie184 avatar Sep 19 '21 17:09 wookie184