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

Use JSON file for config instead of YAML #287

Closed
JasonEtco opened this issue Oct 13, 2017 · 4 comments
Closed

Use JSON file for config instead of YAML #287

JasonEtco opened this issue Oct 13, 2017 · 4 comments

Comments

@JasonEtco
Copy link
Member

Hot take: JSON is easier to parse/work with in a JS environment than YAML. I think (and @bkeepers can confirm) that since Probot is largely a GitHub-related endeavour, YAML was chosen because config files are a standard in Ruby/Rails (and GitHub things). However, since we're living in JS world I think it makes more sense to swap over to JSON. At the very least, we could test to see if it ends in .json and treat it differently that way.

🔥🔥🔥 🚒

@gr2m
Copy link
Contributor

gr2m commented Oct 14, 2017

YAML files are easier to change by hand. As the configuration files are currently mostly edited by people, I’d keep the YAML format.

@bkeepers
Copy link
Contributor

YAML files are easier to change by hand. As the configuration files are currently mostly edited by people, I’d keep the YAML format.

☝️ this is probably the most compelling reason I think it makes sense to stick with YAML for now.

At the very least, we could test to see if it ends in .json and treat it differently that way.

I'm not opposed to this, but I think we should hold out on changing it until changes are implemented based on #258.

@rtsao
Copy link
Contributor

rtsao commented Oct 24, 2017

Config loading is already encapsulated in Probot, therefore shouldn't YAML be equally easy to work with in a JS environment? What benefit is there to switching to JSON?

I think YAML is a better choice than JSON for the following reasons:

  1. YAML supports comments; JSON does not
  2. YAML is more easily read/edited by humans than JSON
  3. JSON git diffs have significantly more noise than YAML diffs
  4. JSON is less opinionated when it come to valid formatting which can exacerbate the above point

The only reason I can think of for using JSON is that parsing JSON is faster and doesn't require a dependency, but that doesn't seem like a worthwhile tradeoff.

While we're bike shedding this, might as well propose using https://github.com/toml-lang/toml 😆

@JasonEtco
Copy link
Member Author

Alright, clearly the people have spoken! Thanks for talking it over everyone, I'll close this out now.

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

No branches or pull requests

4 participants