repos

blog.bythewood.me-flask

mirror archived upstream

Markdown blog on Flask with Vite-built assets and WeasyPrint PDF export, rewritten from the Wagtail build that preceded it.

blogdockerflaskmarkdownpythonself-hostedvite

1.2 KB · 33 lines · markdown Raw History
 1---
 2title: Using EditorConfig to improve coding style consistency
 3slug: using-editorconfig-to-improve-coding-style-consistency
 4date: 2022-05-21
 5publish_date: 2022-05-21
 6tags: coding
 7description: EditorConfig has been around for almost a decade at this point. It is widely supported by many editors natively and many more with plugins.
 8cover_image: editorconfig.org.webp
 9---
10
11EditorConfig has been around for almost a decade at this point. It is widely supported by many editors natively and many more with plugins. You can find more information about their support editors on [EditorConfig's site](https://editorconfig.org/). My current configuration looks something like this.
12
13```shell
14root = true
15
16[*]
17charset = utf-8
18indent_style = space
19indent_size = 2
20end_of_line = lf
21insert_final_newline = true
22trim_trailing_whitespace = true
23
24[*.py]
25indent_size = 4
26
27[*.md]
28trim_trailing_whitespace = false
29indent_size = 4
30```
31
32I currently use a standard `.editorconfig` on all of my projects and the only exceptions are Python and Markdown since I prefer an indent size of 2 but Python's community has standardized around 4 spaces. Markdown also has an odd way of adding line breaks by adding a space at the end of a line so I have to avoid stripping that extra whitespace.