Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 1 | # |
Boyan Karatotev | 82e230f | 2024-09-26 09:08:06 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017-2024, 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) |
Justin Chadwell | 65f4a34 | 2019-08-27 09:43:47 +0100 | [diff] [blame] | 14 | # [PEP8] Style Guide for Python Code |
| 15 | # (https://www.python.org/dev/peps/pep-0008) |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 16 | |
| 17 | |
| 18 | root = 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. |
| 24 | charset = utf-8 |
| 25 | |
| 26 | # Not specified, but implicit for "LINUX coding style". |
| 27 | end_of_line = lf |
| 28 | |
| 29 | # [LCS] Chapter 1: Indentation |
| 30 | # "and thus indentations are also 8 characters" |
| 31 | indent_size = 8 |
| 32 | |
| 33 | # [LCS] Chapter 1: Indentation |
| 34 | # "Outside of comments,...spaces are never used for indentation" |
| 35 | indent_style = tab |
| 36 | |
| 37 | # Not specified by [LCS], but sensible |
| 38 | insert_final_newline = true |
| 39 | |
| 40 | # [LCS] Chapter 2: Breaking long lines and strings |
Yann Gautier | 0622d1f | 2020-08-19 19:07:26 +0200 | [diff] [blame] | 41 | # "The limit on the length of lines is 100 columns" |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 42 | # This is a "soft" requirement for Arm-TF, and should not be the sole |
| 43 | # reason for changes. |
Yann Gautier | 0622d1f | 2020-08-19 19:07:26 +0200 | [diff] [blame] | 44 | max_line_length = 100 |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 45 | |
| 46 | # [LCS] Chapter 1: Indentation |
| 47 | # "Tabs are 8 characters" |
| 48 | tab_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." |
| 54 | trim_trailing_whitespace = true |
| 55 | |
| 56 | |
Paul Beesley | 7ba5620 | 2019-10-21 16:37:13 +0000 | [diff] [blame] | 57 | # Adjustment for ReStructuredText (RST) documentation |
| 58 | [*.{rst}] |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 59 | indent_size = 4 |
| 60 | indent_style = space |
Evan Lloyd | 5cb62a6 | 2017-12-06 19:05:40 +0000 | [diff] [blame] | 61 | |
Justin Chadwell | 65f4a34 | 2019-08-27 09:43:47 +0100 | [diff] [blame] | 62 | |
| 63 | # Adjustment for python which prefers a different style |
| 64 | [*.py] |
| 65 | # [PEP8] Indentation |
| 66 | # "Use 4 spaces per indentation level." |
| 67 | indent_size = 4 |
| 68 | indent_style = space |
| 69 | |
| 70 | # [PEP8] Maximum Line Length |
| 71 | # "Limit all lines to a maximum of 79 characters." |
| 72 | max_line_length = 79 |
Boyan Karatotev | 82e230f | 2024-09-26 09:08:06 +0100 | [diff] [blame] | 73 | |
| 74 | [.git/COMMIT_EDITMSG] |
| 75 | max_line_length = 72 |