Skip to content

Commit

Permalink
Merge pull request ocaml#13748 from MisterDA/editorconfig
Browse files Browse the repository at this point in the history
Add a `.editorconfig` file for basic editor auto-configuration
  • Loading branch information
gasche authored Jan 22, 2025
2 parents 4bfea21 + a31022b commit 26f05d4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.ml*]
indent_style = space

[*.{c,h,h.in,sh,ac,m4}]
indent_style = space
indent_size = 2
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
.gitattributes typo.long-line=may typo.utf8
.gitmodules typo.long-line=may typo.tab=may

.editorconfig typo.missing-header=may

# Binary files
/boot/ocamlc binary
/boot/ocamllex binary
Expand Down Expand Up @@ -53,7 +55,7 @@ tools/mantis2gh_stripped.csv typo.missing-header
META.in typo.missing-header

# Hyperlinks and other markup features cause long lines
*.adoc typo.long-line=may typo.very-long-line=may
*.adoc typo.long-line=may typo.very-long-line=may typo.utf8=may
*.md typo.long-line=may typo.very-long-line=may

# Github templates and scripts lack headers, have long lines
Expand Down
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ Working version
(Ulysse Gérard, Leo White, review by Antonin Décimo, Gabriel Scherer,
Samuel Vivien, Florian Angeletti and Jacques Garrigue)

- #13748: Add a .editorconfig file for basic editor auto-configuration.
(Antonin Décimo, review by Gabriel Scherer and David Allsopp)

### Build system:

- #13431: Simplify github action responsible for flagging PRs with
Expand Down
10 changes: 10 additions & 0 deletions HACKING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ the original commit in the commit message.
git cherry-pick -x -m 1 <merge-commit-hash>
----

=== Code style

Keep the style of the code you’re modifying. We don’t enforce the use of
automated formatters. For OCaml code,
https://github.com/OCamlPro/ocp-indent[ocp-indent] has been used.
We use https://editorconfig.org/[EditorConfig] for simple styling. Lots of
editors support EditorConfig
https://editorconfig.org/#pre-installed[out-of-the-box], or with
https://editorconfig.org/#download[plugins].

[#opam-switch]
=== Testing with `opam`

Expand Down

0 comments on commit 26f05d4

Please sign in to comment.