wiki/contributing/formatting/code.md

1 KiB

title description published date tags editor dateCreated
.editorconfig Formatting standards using .editorconfig true 2024-05-05T19:07:22.836Z markdown 2024-05-05T18:30:37.455Z

Standardization

These .editorconfig files are broken down into language specific sections.

Always include this global portion:

root = true

[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

Programming Languages:

Nix

Using nixfmt-rfc-style

[*.nix]
indent_size = 2
insert_final_newline = false

Python

Using pycodestyle

[*.{py,py3}]
indent_size = 4

Node.js

Using prettier

[*.{cjs,mjs,js,ts,jsx,tsx}]
indent_size = 2

Rust

Using cargo fmt

[*.rs,Cargo.toml]
indent_size = 4
insert_final_newline = false

Data Storage Files

JSON

[*.{json,json5}]
indent_size = 2

CSV

[*.csv]
indent_size = 0