forked from eclipse-cdt-cloud/cdt-gdb-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .editorconfig file, standardize formatting
I see quite a of bit of inconsistency in the formatting. Let's add a .editorconfig file, so the code we write uses the right whitespacing regardless of the editor we use. I just copied the one I wrote earlier for Theia to get started, but it doesn't have to be identical. I used Theia to auto-format all ts and json files and then tslint --fix to fixup any warnings that it would have inserted. For example, I the Typescript formatter handles quite badly (IMO) wrapping long parameter lists, and produces code that result in a warning according to our current tslint config. The Typescript formatter will do this: ``` export class Bob { constructor(a: number, b: number, c: number, d: number, e: number, f: number) { console.log('Hello'); } } ``` where the second line of parameters is indented with 4 spaces. I think is not very readable, because it's easily confused with the first line of code. I prefer our current tslint setting, which requires it to be aligned like this: ``` export class Bob { constructor(a: number, b: number, c: number, d: number, i e: number, f: number) { console.log('Hello'); } } ``` This means that formatting entire documents will always change the code to look like the first snippet above. It's a minor annoyance, and hopefully there will be a setting for that one day in the Typescript formatter. There is an issue about that here: microsoft/TypeScript#11629 Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
- Loading branch information
Simon Marchi
committed
Nov 27, 2018
1 parent
ec78875
commit 80b5495
Showing
11 changed files
with
196 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
end_of_line = lf | ||
indent_style = space | ||
|
||
[*.{js,ts,md}] | ||
indent_size = 4 | ||
|
||
[*.{json,yml}] | ||
indent_size = 2 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.