blob: 21862f764541d253366db7fd7ceef9d123d4df59 [file] [log] [blame]
#
# Copyright (c) 2019, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Trusted Firmware-A Unit Test Coding style spec for editors. (Modified LCS.)
# References:
# [EC] http://editorconfig.org/
# [CONT] contributing.rst
# [LCS] Linux Coding Style
# (https://www.kernel.org/doc/html/v4.10/process/coding-style.html)
root = true
# set default to match [LCS] .c/.h settings.
# This will also apply to .S, .mk, .sh, Makefile, .dts, etc.
[*.{c,h,cpp,hpp}]
# Not specified, but fits current ARM-TF sources.
charset = utf-8
# Not specified, but implicit for "LINUX coding style".
end_of_line = lf
# Override LCS on indentation settings.
indent_size = 2
indent_style = space
tab_width = 2
# Not specified by [LCS], but sensible
insert_final_newline = true
# [LCS] Chapter 2: Breaking long lines and strings
# "The limit on the length of lines is 80 columns"
# This is a "soft" requirement for Arm-TF, and should not be the sole
# reason for changes.
max_line_length = 80
# [LCS] Chapter 1: Indentation
# "Get a decent editor and don't leave whitespace at the end of lines."
# [LCS] Chapter 3.1: Spaces
# "Do not leave trailing whitespace at the ends of lines."
trim_trailing_whitespace = true
#Makefiles must use tabs, so set indentation accordingly.
[makefile, *.mk]
indent_size = 4
indent_style = tab
tab_width = 4
# Adjustment for existing .rst files with different format
[*.{rst,md}]
indent_size = 4
indent_style = space
max_line_length = 180
# 180 only selected to prevent changes to existing text.
tab_width = 4
# Python code
[*.py]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 2
max_line_length = 180
tab_width = 4
#Cmake files
[*.cmake, CMakeLists.txt]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 2
max_line_length = 180
tab_width = 4