blob: 21862f764541d253366db7fd7ceef9d123d4df59 [file] [log] [blame]
Gyorgy Szing05ece0e2019-10-08 12:56:59 +02001#
2# Copyright (c) 2019, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# Trusted Firmware-A Unit Test Coding style spec for editors. (Modified LCS.)
8
9# References:
10# [EC] http://editorconfig.org/
11# [CONT] contributing.rst
12# [LCS] Linux Coding Style
13# (https://www.kernel.org/doc/html/v4.10/process/coding-style.html)
14
15
16root = true
17
18# set default to match [LCS] .c/.h settings.
19# This will also apply to .S, .mk, .sh, Makefile, .dts, etc.
20[*.{c,h,cpp,hpp}]
21# Not specified, but fits current ARM-TF sources.
22charset = utf-8
23
24# Not specified, but implicit for "LINUX coding style".
25end_of_line = lf
26
27# Override LCS on indentation settings.
28indent_size = 2
29indent_style = space
30tab_width = 2
31
32# Not specified by [LCS], but sensible
33insert_final_newline = true
34
35# [LCS] Chapter 2: Breaking long lines and strings
36# "The limit on the length of lines is 80 columns"
37# This is a "soft" requirement for Arm-TF, and should not be the sole
38# reason for changes.
39max_line_length = 80
40
41# [LCS] Chapter 1: Indentation
42# "Get a decent editor and don't leave whitespace at the end of lines."
43# [LCS] Chapter 3.1: Spaces
44# "Do not leave trailing whitespace at the ends of lines."
45trim_trailing_whitespace = true
46
47#Makefiles must use tabs, so set indentation accordingly.
48[makefile, *.mk]
49indent_size = 4
50indent_style = tab
51tab_width = 4
52
53# Adjustment for existing .rst files with different format
54[*.{rst,md}]
55indent_size = 4
56indent_style = space
57max_line_length = 180
58# 180 only selected to prevent changes to existing text.
59tab_width = 4
60
61# Python code
62[*.py]
63charset = utf-8
64indent_style = space
65indent_size = 2
66indent_size = 2
67max_line_length = 180
68tab_width = 4
69
70#Cmake files
71[*.cmake, CMakeLists.txt]
72charset = utf-8
73indent_style = space
74indent_size = 2
75indent_size = 2
76max_line_length = 180
77tab_width = 4