Skip to content

Commit 20fffa8

Browse files
Use .editorconfig to help with code style consistency (chakra-core#6866)
* add basic `.editorconfig` * Fix copyright * Fix tabs
1 parent fd69080 commit 20fffa8

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
# See https://github.com/chakra-core/ChakraCore/wiki/Coding-Convention
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
9+
# See https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019
10+
[*.{cpp,h,inl}]
11+
cpp_space_pointer_reference_alignment = right
12+
cpp_new_line_before_open_brace_block = new_line
13+
cpp_new_line_before_catch = true
14+
cpp_new_line_before_else = true
15+
16+
# Xml files
17+
[*.xml]
18+
indent_size = 2

Build/Chakra.Core.sln

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Stubdata", "..\d
168168
EndProject
169169
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.SCACore", "..\lib\SCACore\Chakra.SCACore.vcxproj", "{4DA3A367-6ED2-4EE8-9698-5BCD0B8AF7F5}"
170170
EndProject
171+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EditorConfig", "EditorConfig", "{9EAC0ED9-9EC0-492E-975B-92CA3FE527C8}"
172+
ProjectSection(SolutionItems) = preProject
173+
..\.editorconfig = ..\.editorconfig
174+
EndProjectSection
175+
EndProject
171176
Global
172177
GlobalSection(SolutionConfigurationPlatforms) = preSolution
173178
Debug|ARM = Debug|ARM

tools/StyleChecks/check_copyright.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#-------------------------------------------------------------------------------------------------------
22
# Copyright (C) Microsoft. All rights reserved.
3-
# Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
3+
# Copyright (c) ChakraCore Project Contributors. All rights reserved.
44
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
55
#-------------------------------------------------------------------------------------------------------
66

@@ -42,6 +42,7 @@ git diff --name-only `git merge-base origin/master HEAD` HEAD |
4242
grep -v -E '\.json$' |
4343
grep -v -E '\.man$' |
4444
grep -v -E '\.testconfig$' |
45+
grep -v -E '\.editorconfig$' |
4546
grep -v -E '\.proj$' |
4647
grep -v -E '\.png$' |
4748
grep -v -E 'packages.config$' |

0 commit comments

Comments
 (0)