Skip to content

Commit

Permalink
Use .editorconfig to help with code style consistency (chakra-core#…
Browse files Browse the repository at this point in the history
…6866)

* add basic `.editorconfig`

* Fix copyright

* Fix tabs
  • Loading branch information
ShortDevelopment authored Dec 28, 2022
1 parent fd69080 commit 20fffa8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

# See https://github.com/chakra-core/ChakraCore/wiki/Coding-Convention

[*]
indent_style = space
indent_size = 4

# See https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019
[*.{cpp,h,inl}]
cpp_space_pointer_reference_alignment = right
cpp_new_line_before_open_brace_block = new_line
cpp_new_line_before_catch = true
cpp_new_line_before_else = true

# Xml files
[*.xml]
indent_size = 2
5 changes: 5 additions & 0 deletions Build/Chakra.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.ICU.Stubdata", "..\d
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra.SCACore", "..\lib\SCACore\Chakra.SCACore.vcxproj", "{4DA3A367-6ED2-4EE8-9698-5BCD0B8AF7F5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EditorConfig", "EditorConfig", "{9EAC0ED9-9EC0-492E-975B-92CA3FE527C8}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Expand Down
3 changes: 2 additions & 1 deletion tools/StyleChecks/check_copyright.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#-------------------------------------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
# Copyright (c) ChakraCore Project Contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
#-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -42,6 +42,7 @@ git diff --name-only `git merge-base origin/master HEAD` HEAD |
grep -v -E '\.json$' |
grep -v -E '\.man$' |
grep -v -E '\.testconfig$' |
grep -v -E '\.editorconfig$' |
grep -v -E '\.proj$' |
grep -v -E '\.png$' |
grep -v -E 'packages.config$' |
Expand Down

0 comments on commit 20fffa8

Please sign in to comment.