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

[v3] Configure online editor #937

Closed
Tracked by #946
ErikSchierboom opened this issue Jan 29, 2021 · 2 comments
Closed
Tracked by #946

[v3] Configure online editor #937

ErikSchierboom opened this issue Jan 29, 2021 · 2 comments

Comments

@ErikSchierboom
Copy link
Member

This issue is part of the migration to v3. You can read full details about the various changes here.

In Exercism v3, students can now choose to work on exercises directly from their browser, instead of having to download exercises to their local machine. The track-specific settings for the in-browser editor are defined in the top-level "online_editor" field in the track's config.json file. This field is defined as an object with two fields:

  • "indent_style": the indent style, either "space" or "tab".
  • "indent_size": the indent size, which is an integer (e.g. 4).

You can find a full description of these fields in the spec.

Goal

The "online_editor" field should be updated to correspond to the track's best practices regarding indentation.

Example

"online_editor": {
  "indent_style": "space",
  "indent_size": 4
}

Tracking

exercism/v3-launch#2

This was referenced Jan 29, 2021
@sshine
Copy link
Contributor

sshine commented Feb 3, 2021

I don't know that there exists a correct value for this. In part because there is not one fixed best indentation practice in Haskell, and in part because indentation in Haskell is not always done with one fixed set of indentation columns. See for example Kowainik's style guide that recommends a mixture of 2 and 4 spaces, or dmwit's "I mix tabs and spaces.", or observe that there are multiple code formatters (Ormolu, Brittany, Hindent) that do not agree either.

Assuming that we cannot find a correct value, and we have to pick one, perhaps we can find a value with some other property, such as popularity (e.g. 4 spaces) or ability to work in most situations where you'd normally have different values (e.g. 2 spaces).

@sshine
Copy link
Contributor

sshine commented Feb 9, 2021

#936 somewhat arbitrarily sets this to 2 spaces.

It is a consequence of merging exercism/v3#51, where I picked 2 spaces because it appeared, to me, to be the option that most easily aligns with the many indentation styles that people have. So while 4 spaces is the more popular choice in general, 2 spaces allows for both "always indent by 2 spaces" and "sometimes indent by 2 spaces, sometimes by 4 spaces", e.g. as in:

foo :: T
foo =
    bar
  where
    bar = ...

I will close this issue, and we can refer back to it in the event that someone should find a better way to justify having any one default.

@sshine sshine closed this as completed Feb 9, 2021
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

2 participants