Skip to content

Commit

Permalink
Dev: enforce consistent styles with EditorConfig (#34)
Browse files Browse the repository at this point in the history
CLOSE
https://linear.app/sourcegraph/issue/CODY-3142/set-up-linter-formatter

Thanks to Piotr for letting us know about the EditorConfig file which
allows us to enforce consistent styles with EditorConfig to avoid
inconsistent spacing and formatting that would cause diff conflicts.

Please feel free to suggest any changes to the configurations before I
run them code clean up on all the files in the current codebase. Any
code that's added after the editorconfig file will be automatically
cleaned up:
https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022

See
https://learn.microsoft.com/en-us/visualstudio/ide/code-styles-and-code-cleanup?view=vs-2022&source=recommendations
  • Loading branch information
abeatrix authored Aug 14, 2024
1 parent b9a73c9 commit 4d789b2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true

# Matches Cody Main Repository
[*]
insert_final_newline = true
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[{*.json,*.yml,*.yaml,*.md}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[{*.sh, *.bash}]
indent_style = space
indent_size = 2
switch_case_indent = true

[**/{node_modules,dist}/**]
ignore = true

# C# files
[*.cs]

#### Core EditorConfig Options ####

# Indentation and spacing
tab_width = 4

0 comments on commit 4d789b2

Please sign in to comment.