Skip to content

Commit bc86603

Browse files
committed
make: Adding meson.format and .editorconfig
Adding meson.format and .editorconfig to make sure all our files are edited consistently across platforms and tools that we use. Where it is necessary, the rules specified match .clang-format to make sure everything is configured correctly. Signed-off-by: Tyler Erickson <[email protected]>
1 parent 62f940f commit bc86603

File tree

5 files changed

+407
-271
lines changed

5 files changed

+407
-271
lines changed

.editorconfig

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# See https://spec.editorconfig.org/
3+
# See https://editorconfig.org/
4+
5+
root = true
6+
7+
# Rules for all files
8+
[*]
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
charset = utf-8
12+
spelling_language = en-US
13+
14+
# Rules for C and C++ source files
15+
[*.{c, h, cpp, hpp}]
16+
indent_style = space
17+
indent_size = 4
18+
# Do not specify line endings since git's checkout will set to system's native value
19+
end_of_line = unset
20+
21+
# Microsoft resource files
22+
[*.rc]
23+
indent_style = space
24+
indent_size = 4
25+
charset = utf-8-bom
26+
end_of_line = crlf
27+
28+
# Rules for Makefiles
29+
[Makefile,GNUMakefile,GNUmakefile,Makefile.gccWin]
30+
indent_style = tab
31+
end_of_line = lf
32+
33+
# Shell script rules
34+
[*.sh]
35+
indent_style = space
36+
indent_size = 4
37+
end_of_line = lf
38+
39+
# Batch files
40+
[*.{bat, cmd}]
41+
end_of_line = crlf
42+
charset = utf-8-bom
43+
indent_size = 4
44+
indent_style = space
45+
tab_width = 4
46+
47+
# Powershell scripts
48+
[*.ps1]
49+
indent_style = space
50+
indent_size = 4
51+
end_of_line = crlf
52+
charset = utf-8-bom
53+
54+
# Clang format and tidy configuration files
55+
[.clang-format]
56+
indent_style = space
57+
indent_size = 4
58+
end_of_line = lf
59+
60+
[.clang-tidy]
61+
indent_style = space
62+
indent_size = 4
63+
end_of_line = lf
64+
65+
# Configuration/CI/YAML/JSON/XML files
66+
[*.{yaml,yml,xml,json,whitesource,ini,cfg,toml,conf}]
67+
indent_style = space
68+
indent_size = 2
69+
charset = utf-8
70+
end_of_line = lf
71+
72+
# Markdown files
73+
[*.md]
74+
indent_style = space
75+
indent_size = 2
76+
charset = utf-8
77+
end_of_line = lf
78+
trim_trailing_whitespace = false
79+
80+
# Git configuration files
81+
[.{gitattributes,gitignore,gitmodules}]
82+
indent_style = space
83+
indent_size = 2
84+
charset = utf-8
85+
end_of_line = lf
86+
87+
# Generic text files
88+
[*.txt]
89+
indent_style = space
90+
indent_size = 2
91+
charset = utf-8
92+
end_of_line = crlf # For Windows compatibility when editors don't understand unix line endings
93+
94+
# Visual studio
95+
[*.{vcxproj,csproj,sln,vcxproj.filters}]
96+
indent_style = space
97+
indent_size = 2
98+
charset = utf-8-bom
99+
end_of_line = crlf
100+
101+
# UEFI build files
102+
[*.{dec,dsc,inf}]
103+
indent_style = space
104+
indent_size = 4
105+
end_of_line = lf
106+
107+
# Python files
108+
[*.py]
109+
indent_style = space
110+
indent_size = 4
111+
charset = utf-8
112+
end_of_line = lf
113+
114+
# Meson build files
115+
[meson.build,meson_options.txt,meson.options]
116+
indent_style = space
117+
indent_size = 4
118+
end_of_line = lf
119+
charset = utf-8
120+
max_line_length = 120
121+
insert_final_newline = true
122+
tab_width = 4
123+
124+
# Meson subproject wrappers
125+
[*.wrap]
126+
indent_style = space
127+
indent_size = 4
128+
end_of_line = lf
129+
charset = utf-8

0 commit comments

Comments
 (0)