Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 1 | # |
John Tsichritzis | 63801cd | 2019-07-05 14:22:12 +0100 | [diff] [blame^] | 2 | # Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved. |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
John Tsichritzis | 63801cd | 2019-07-05 14:22:12 +0100 | [diff] [blame^] | 7 | # Trusted Firmware-A Coding style spec for editors. |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 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 | |
| 16 | root = true |
| 17 | |
| 18 | # set default to match [LCS] .c/.h settings. |
| 19 | # This will also apply to .S, .mk, .sh, Makefile, .dts, etc. |
| 20 | [*] |
| 21 | # Not specified, but fits current ARM-TF sources. |
| 22 | charset = utf-8 |
| 23 | |
| 24 | # Not specified, but implicit for "LINUX coding style". |
| 25 | end_of_line = lf |
| 26 | |
| 27 | # [LCS] Chapter 1: Indentation |
| 28 | # "and thus indentations are also 8 characters" |
| 29 | indent_size = 8 |
| 30 | |
| 31 | # [LCS] Chapter 1: Indentation |
| 32 | # "Outside of comments,...spaces are never used for indentation" |
| 33 | indent_style = tab |
| 34 | |
| 35 | # Not specified by [LCS], but sensible |
| 36 | insert_final_newline = true |
| 37 | |
| 38 | # [LCS] Chapter 2: Breaking long lines and strings |
| 39 | # "The limit on the length of lines is 80 columns" |
| 40 | # This is a "soft" requirement for Arm-TF, and should not be the sole |
| 41 | # reason for changes. |
| 42 | max_line_length = 80 |
| 43 | |
| 44 | # [LCS] Chapter 1: Indentation |
| 45 | # "Tabs are 8 characters" |
| 46 | tab_width = 8 |
| 47 | |
| 48 | # [LCS] Chapter 1: Indentation |
| 49 | # "Get a decent editor and don't leave whitespace at the end of lines." |
| 50 | # [LCS] Chapter 3.1: Spaces |
| 51 | # "Do not leave trailing whitespace at the ends of lines." |
| 52 | trim_trailing_whitespace = true |
| 53 | |
| 54 | |
| 55 | # Adjustment for existing .rst files with different format |
| 56 | [*.{rst,md}] |
| 57 | indent_size = 4 |
| 58 | indent_style = space |
| 59 | max_line_length = 180 |
| 60 | # 180 only selected to prevent changes to existing text. |
| 61 | tab_width = 4 |
| 62 | |