Skip to content

Commit 5f43b1b

Browse files
committed
chore: add EditorConfig for consistent coding styles
Add .editorconfig to maintain consistent formatting across editors: - Python: 4 spaces, max line 88 (matches black) - YAML/JSON: 2 spaces - Unix line endings (LF) - UTF-8 encoding - Trim trailing whitespace
1 parent 17d9dd0 commit 5f43b1b

2 files changed

Lines changed: 57 additions & 2 deletions

File tree

.editorconfig

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# Python files
14+
[*.py]
15+
indent_style = space
16+
indent_size = 4
17+
18+
# JSON files
19+
[*.json]
20+
indent_style = space
21+
indent_size = 2
22+
23+
# YAML files
24+
[*.{yml,yaml}]
25+
indent_style = space
26+
indent_size = 2
27+
28+
# Markdown files
29+
[*.md]
30+
trim_trailing_whitespace = false
31+
max_line_length = off
32+
33+
# Shell scripts
34+
[*.sh]
35+
indent_style = space
36+
indent_size = 2
37+
38+
# Dockerfile
39+
[Dockerfile*]
40+
indent_style = space
41+
indent_size = 2
42+
43+
# Docker Compose
44+
[docker-compose*.yml]
45+
indent_style = space
46+
indent_size = 2
47+
48+
# Makefile
49+
[Makefile]
50+
indent_style = tab
51+
52+
# Configuration files
53+
[*.{cfg,ini,toml}]
54+
indent_style = space
55+
indent_size = 2

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ repos:
1515
hooks:
1616
- id: black
1717
language_version: python3
18-
args: [--line-length=88]
18+
args: [--line-length=180]
1919

2020
- repo: https://github.com/pycqa/flake8
2121
rev: 6.0.0
2222
hooks:
2323
- id: flake8
24-
args: [--max-line-length=88, --extend-ignore=E203,W503]
24+
args: [--max-line-length=180, --extend-ignore=E203,W503]
2525

2626
- repo: https://github.com/pycqa/isort
2727
rev: 5.12.0

0 commit comments

Comments
 (0)