Gyorgy Szing | 4021c29 | 2020-11-24 00:33:00 +0100 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | |
| 8 | # References: |
| 9 | # [LCS] Linux Coding Style |
| 10 | # (https://www.kernel.org/doc/html/v4.10/process/coding-style.html) |
| 11 | # [PEP8] Style Guide for Python Code |
| 12 | # (https://www.python.org/dev/peps/pep-0008) |
| 13 | |
| 14 | root = true |
| 15 | |
| 16 | ################################ |
| 17 | # Default settings for all files |
| 18 | [*] |
| 19 | # Windows .bat files may have trouble with utf8 and will fail with lf line ends. |
| 20 | # Currently no plans to add .bat files, but this can be an issue in the future. |
| 21 | charset = uft-8 |
| 22 | end_of_line = lf |
| 23 | trim_trailing_whitespace = true |
| 24 | indent_size = 4 |
| 25 | indent_style = tab |
| 26 | |
| 27 | ################################ |
| 28 | #C and C++, follow LCS |
| 29 | [*.{c,h,cpp,hpp}] |
| 30 | |
| 31 | # [LCS] Chapter 1: Indentation |
| 32 | # "Tabs are 8 characters" |
| 33 | tab_width = 8 |
| 34 | |
| 35 | # [LCS] Chapter 1: Indentation |
| 36 | # "and thus indentations are also 8 characters" |
| 37 | indent_size = 8 |
| 38 | |
| 39 | # [LCS] Chapter 1: Indentation |
| 40 | # "Outside of comments,...spaces are never used for indentation" |
| 41 | indent_style = tab |
| 42 | |
| 43 | # [LCS] Chapter 2: Breaking long lines and strings |
| 44 | # "Statements may be up to 100 columns when appropriate." |
| 45 | # This is a "soft" requirement for Arm-TF, and should not be the sole |
| 46 | # reason for changes. |
| 47 | max_line_length = 100 |
| 48 | |
| 49 | # [LCS] Chapter 1: Indentation |
| 50 | # "Get a decent editor and don't leave whitespace at the end of lines." |
| 51 | # [LCS] Chapter 3.1: Spaces |
| 52 | # "Do not leave trailing whitespace at the ends of lines." |
| 53 | trim_trailing_whitespace = true |
| 54 | |
| 55 | |
| 56 | ################################ |
| 57 | #CMake specific settings |
| 58 | [{CMakeLists.txt,*.cmake}] |
| 59 | charset = utf-8 |
| 60 | end_of_line = lf |
| 61 | indent_size = 4 |
| 62 | indent_style = tab |
| 63 | insert_final_newline = false |
| 64 | max_line_length = 128 |
| 65 | trim_trailing_whitespace = true |
| 66 | |
| 67 | ################################ |
| 68 | #Documentation |
| 69 | [*.{rst,md}] |
| 70 | charset = utf-8 |
| 71 | end_of_line = lf |
| 72 | indent_size = 4 |
| 73 | indent_style = space |
| 74 | insert_final_newline = false |
| 75 | max_line_length = 128 |
| 76 | tab_width = 4 |
| 77 | trim_trailing_whitespace = true |
| 78 | |
| 79 | ################################ |
| 80 | # Python code |
| 81 | [*.py] |
| 82 | # [PEP8] Indentation |
| 83 | # "Use 4 spaces per indentation level." |
| 84 | indent_size = 4 |
| 85 | indent_style = space |
| 86 | # [PEP8] Maximum Line Length |
| 87 | # "Limit all lines to a maximum of 79 characters." |
| 88 | max_line_length = 79 |
| 89 | |
| 90 | ################################ |
| 91 | # Makefiles |
| 92 | [{Makefile,*.mk}] |
| 93 | indent_style = tab |
| 94 | indent_size = 4 |
| 95 | |
| 96 | ################################ |
| 97 | # json,yaml and xml files |
| 98 | [{*.json,*.yaml,*.xml}] |
| 99 | indent_style = space |
| 100 | indent_size = 4 |
| 101 | tab_width = 4 |
| 102 | trim_trailing_whitespace = true |