Skip to content

Commit 5e860c1

Browse files
authored
Add editorconfig support (frequenz-floss#108)
Editorconfig is a standard way to specific basic editor configuration accross different editors. For more information see https://editorconfig.org/. - cookiecutter: Add .editorconfig - Add .editorconfig Fixes frequenz-floss#24.
2 parents 7799c1a + dc19d28 commit 5e860c1

File tree

15 files changed

+191
-0
lines changed

15 files changed

+191
-0
lines changed

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- "**/*.toml"
2525
- "**/*.yaml"
2626
- "**/*.yml"
27+
- ".editorconfig"
2728
- ".git*"
2829
- ".git*/**"
2930
- CODEOWNERS

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646

4747
This makes sure that we don't ship useless files when building the distribution package and that we include all the relevant files too, like generated *.pyi files for API repositories.
4848

49+
- Add an `.editorconfig` file to ensure a common basic editor configuration for different file types.
50+
4951
## Bug Fixes
5052

5153
- The distribution package doesn't include tests and other useless files anymore.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

cookiecutter/{{cookiecutter.github_repo_name}}/.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
- "**/*.toml"
4545
- "**/*.yaml"
4646
- "**/*.yml"
47+
- ".editorconfig"
4748
- ".git*"
4849
- ".git*/**"
4950
- "docs/*.py"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- "**/*.toml"
4141
- "**/*.yaml"
4242
- "**/*.yml"
43+
- ".editorconfig"
4344
- ".git*"
4445
- ".git*/**"
4546
- "docs/*.py"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- "**/*.toml"
4141
- "**/*.yaml"
4242
- "**/*.yml"
43+
- ".editorconfig"
4344
- ".git*"
4445
- ".git*/**"
4546
- "docs/*.py"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

0 commit comments

Comments
 (0)