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

Add .editorconfig #871

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Add .editorconfig #871

wants to merge 1 commit into from

Conversation

br4sco
Copy link
Contributor

@br4sco br4sco commented Oct 22, 2024

Rather than just specify code formating in the wiki I suggest that we add an https://editorconfig.org/ configuration with our specification. The benefit is that many editors has builtin support for editorconfig (and even more have optional plugins), meaning that they will automatically indent code etc. according to our specification when editing files in this repo.

@johnwikman
Copy link
Contributor

I generally like this, but the root directory is becoming really crowded now. Can this file replace other things? Such as mcore-comby.json, .ocamlformat, etc.

@br4sco
Copy link
Contributor Author

br4sco commented Oct 23, 2024

It is more general (in the sense that it is agnostic to the language), but it only governs indentation style and whitespace. It cannot replace ocamlformat, which is a full-fledges code formatter, for example. I still think this is better than only specifying this in the wiki (as we do now).

@br4sco
Copy link
Contributor Author

br4sco commented Oct 23, 2024

Regarding .ocamlformat, we could move that to the src/boot where the OCaml code lives.

@johnwikman
Copy link
Contributor

johnwikman commented Nov 18, 2024

By the way, could we perhaps have this file format as an interface for pretty printing in the future as well? I.e. the pretty printer uses a editorconfig config (a default setting or loaded from file) to determine the style of the output.

Something like mi fmt <file> would then look for an .editorconfig file to determine how it should pretty print the program.

From the spec (link):

EditorConfig plugins shall ignore unrecognized keys and invalid/unsupported values.

So I guess that we can add basically any additional information we need to a .editorconfig file?

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

Successfully merging this pull request may close these issues.

2 participants