1*91f16700Schasinglulu# 2*91f16700Schasinglulu# Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved. 3*91f16700Schasinglulu# 4*91f16700Schasinglulu# SPDX-License-Identifier: BSD-3-Clause 5*91f16700Schasinglulu# 6*91f16700Schasinglulu 7*91f16700Schasinglulu# Trusted Firmware-A Coding style spec for editors. 8*91f16700Schasinglulu 9*91f16700Schasinglulu# References: 10*91f16700Schasinglulu# [EC] http://editorconfig.org/ 11*91f16700Schasinglulu# [CONT] contributing.rst 12*91f16700Schasinglulu# [LCS] Linux Coding Style 13*91f16700Schasinglulu# (https://www.kernel.org/doc/html/v4.10/process/coding-style.html) 14*91f16700Schasinglulu# [PEP8] Style Guide for Python Code 15*91f16700Schasinglulu# (https://www.python.org/dev/peps/pep-0008) 16*91f16700Schasinglulu 17*91f16700Schasinglulu 18*91f16700Schasingluluroot = true 19*91f16700Schasinglulu 20*91f16700Schasinglulu# set default to match [LCS] .c/.h settings. 21*91f16700Schasinglulu# This will also apply to .S, .mk, .sh, Makefile, .dts, etc. 22*91f16700Schasinglulu[*] 23*91f16700Schasinglulu# Not specified, but fits current ARM-TF sources. 24*91f16700Schasinglulucharset = utf-8 25*91f16700Schasinglulu 26*91f16700Schasinglulu# Not specified, but implicit for "LINUX coding style". 27*91f16700Schasingluluend_of_line = lf 28*91f16700Schasinglulu 29*91f16700Schasinglulu# [LCS] Chapter 1: Indentation 30*91f16700Schasinglulu# "and thus indentations are also 8 characters" 31*91f16700Schasingluluindent_size = 8 32*91f16700Schasinglulu 33*91f16700Schasinglulu# [LCS] Chapter 1: Indentation 34*91f16700Schasinglulu# "Outside of comments,...spaces are never used for indentation" 35*91f16700Schasingluluindent_style = tab 36*91f16700Schasinglulu 37*91f16700Schasinglulu# Not specified by [LCS], but sensible 38*91f16700Schasingluluinsert_final_newline = true 39*91f16700Schasinglulu 40*91f16700Schasinglulu# [LCS] Chapter 2: Breaking long lines and strings 41*91f16700Schasinglulu# "The limit on the length of lines is 100 columns" 42*91f16700Schasinglulu# This is a "soft" requirement for Arm-TF, and should not be the sole 43*91f16700Schasinglulu# reason for changes. 44*91f16700Schasinglulumax_line_length = 100 45*91f16700Schasinglulu 46*91f16700Schasinglulu# [LCS] Chapter 1: Indentation 47*91f16700Schasinglulu# "Tabs are 8 characters" 48*91f16700Schasinglulutab_width = 8 49*91f16700Schasinglulu 50*91f16700Schasinglulu# [LCS] Chapter 1: Indentation 51*91f16700Schasinglulu# "Get a decent editor and don't leave whitespace at the end of lines." 52*91f16700Schasinglulu# [LCS] Chapter 3.1: Spaces 53*91f16700Schasinglulu# "Do not leave trailing whitespace at the ends of lines." 54*91f16700Schasinglulutrim_trailing_whitespace = true 55*91f16700Schasinglulu 56*91f16700Schasinglulu 57*91f16700Schasinglulu# Adjustment for ReStructuredText (RST) documentation 58*91f16700Schasinglulu[*.{rst}] 59*91f16700Schasingluluindent_size = 4 60*91f16700Schasingluluindent_style = space 61*91f16700Schasinglulu 62*91f16700Schasinglulu 63*91f16700Schasinglulu# Adjustment for python which prefers a different style 64*91f16700Schasinglulu[*.py] 65*91f16700Schasinglulu# [PEP8] Indentation 66*91f16700Schasinglulu# "Use 4 spaces per indentation level." 67*91f16700Schasingluluindent_size = 4 68*91f16700Schasingluluindent_style = space 69*91f16700Schasinglulu 70*91f16700Schasinglulu# [PEP8] Maximum Line Length 71*91f16700Schasinglulu# "Limit all lines to a maximum of 79 characters." 72*91f16700Schasinglulumax_line_length = 79 73