blob: b14e0253b131153170299579e6926c92b9a21a69 [file] [log] [blame]
Evan Lloyd5cb62a62017-12-06 19:05:40 +00001#
John Tsichritzis63801cd2019-07-05 14:22:12 +01002# Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved.
Evan Lloyd5cb62a62017-12-06 19:05:40 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
John Tsichritzis63801cd2019-07-05 14:22:12 +01007# Trusted Firmware-A Coding style spec for editors.
Evan Lloyd5cb62a62017-12-06 19:05:40 +00008
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)
Justin Chadwell65f4a342019-08-27 09:43:47 +010014# [PEP8] Style Guide for Python Code
15# (https://www.python.org/dev/peps/pep-0008)
Evan Lloyd5cb62a62017-12-06 19:05:40 +000016
17
18root = true
19
20# set default to match [LCS] .c/.h settings.
21# This will also apply to .S, .mk, .sh, Makefile, .dts, etc.
22[*]
23# Not specified, but fits current ARM-TF sources.
24charset = utf-8
25
26# Not specified, but implicit for "LINUX coding style".
27end_of_line = lf
28
29# [LCS] Chapter 1: Indentation
30# "and thus indentations are also 8 characters"
31indent_size = 8
32
33# [LCS] Chapter 1: Indentation
34# "Outside of comments,...spaces are never used for indentation"
35indent_style = tab
36
37# Not specified by [LCS], but sensible
38insert_final_newline = true
39
40# [LCS] Chapter 2: Breaking long lines and strings
41# "The limit on the length of lines is 80 columns"
42# This is a "soft" requirement for Arm-TF, and should not be the sole
43# reason for changes.
44max_line_length = 80
45
46# [LCS] Chapter 1: Indentation
47# "Tabs are 8 characters"
48tab_width = 8
49
50# [LCS] Chapter 1: Indentation
51# "Get a decent editor and don't leave whitespace at the end of lines."
52# [LCS] Chapter 3.1: Spaces
53# "Do not leave trailing whitespace at the ends of lines."
54trim_trailing_whitespace = true
55
56
57# Adjustment for existing .rst files with different format
58[*.{rst,md}]
59indent_size = 4
60indent_style = space
61max_line_length = 180
62# 180 only selected to prevent changes to existing text.
63tab_width = 4
64
Justin Chadwell65f4a342019-08-27 09:43:47 +010065
66# Adjustment for python which prefers a different style
67[*.py]
68# [PEP8] Indentation
69# "Use 4 spaces per indentation level."
70indent_size = 4
71indent_style = space
72
73# [PEP8] Maximum Line Length
74# "Limit all lines to a maximum of 79 characters."
75max_line_length = 79