15d9cef94SEvan Lloyd# 2bd97f83aSJohn Tsichritzis# Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved. 35d9cef94SEvan Lloyd# 45d9cef94SEvan Lloyd# SPDX-License-Identifier: BSD-3-Clause 55d9cef94SEvan Lloyd# 65d9cef94SEvan Lloyd 7bd97f83aSJohn Tsichritzis# Trusted Firmware-A Coding style spec for editors. 85d9cef94SEvan Lloyd 95d9cef94SEvan Lloyd# References: 105d9cef94SEvan Lloyd# [EC] http://editorconfig.org/ 115d9cef94SEvan Lloyd# [CONT] contributing.rst 125d9cef94SEvan Lloyd# [LCS] Linux Coding Style 135d9cef94SEvan Lloyd# (https://www.kernel.org/doc/html/v4.10/process/coding-style.html) 14*40b06510SJustin Chadwell# [PEP8] Style Guide for Python Code 15*40b06510SJustin Chadwell# (https://www.python.org/dev/peps/pep-0008) 165d9cef94SEvan Lloyd 175d9cef94SEvan Lloyd 185d9cef94SEvan Lloydroot = true 195d9cef94SEvan Lloyd 205d9cef94SEvan Lloyd# set default to match [LCS] .c/.h settings. 215d9cef94SEvan Lloyd# This will also apply to .S, .mk, .sh, Makefile, .dts, etc. 225d9cef94SEvan Lloyd[*] 235d9cef94SEvan Lloyd# Not specified, but fits current ARM-TF sources. 245d9cef94SEvan Lloydcharset = utf-8 255d9cef94SEvan Lloyd 265d9cef94SEvan Lloyd# Not specified, but implicit for "LINUX coding style". 275d9cef94SEvan Lloydend_of_line = lf 285d9cef94SEvan Lloyd 295d9cef94SEvan Lloyd# [LCS] Chapter 1: Indentation 305d9cef94SEvan Lloyd# "and thus indentations are also 8 characters" 315d9cef94SEvan Lloydindent_size = 8 325d9cef94SEvan Lloyd 335d9cef94SEvan Lloyd# [LCS] Chapter 1: Indentation 345d9cef94SEvan Lloyd# "Outside of comments,...spaces are never used for indentation" 355d9cef94SEvan Lloydindent_style = tab 365d9cef94SEvan Lloyd 375d9cef94SEvan Lloyd# Not specified by [LCS], but sensible 385d9cef94SEvan Lloydinsert_final_newline = true 395d9cef94SEvan Lloyd 405d9cef94SEvan Lloyd# [LCS] Chapter 2: Breaking long lines and strings 415d9cef94SEvan Lloyd# "The limit on the length of lines is 80 columns" 425d9cef94SEvan Lloyd# This is a "soft" requirement for Arm-TF, and should not be the sole 435d9cef94SEvan Lloyd# reason for changes. 445d9cef94SEvan Lloydmax_line_length = 80 455d9cef94SEvan Lloyd 465d9cef94SEvan Lloyd# [LCS] Chapter 1: Indentation 475d9cef94SEvan Lloyd# "Tabs are 8 characters" 485d9cef94SEvan Lloydtab_width = 8 495d9cef94SEvan Lloyd 505d9cef94SEvan Lloyd# [LCS] Chapter 1: Indentation 515d9cef94SEvan Lloyd# "Get a decent editor and don't leave whitespace at the end of lines." 525d9cef94SEvan Lloyd# [LCS] Chapter 3.1: Spaces 535d9cef94SEvan Lloyd# "Do not leave trailing whitespace at the ends of lines." 545d9cef94SEvan Lloydtrim_trailing_whitespace = true 555d9cef94SEvan Lloyd 565d9cef94SEvan Lloyd 575d9cef94SEvan Lloyd# Adjustment for existing .rst files with different format 585d9cef94SEvan Lloyd[*.{rst,md}] 595d9cef94SEvan Lloydindent_size = 4 605d9cef94SEvan Lloydindent_style = space 615d9cef94SEvan Lloydmax_line_length = 180 625d9cef94SEvan Lloyd# 180 only selected to prevent changes to existing text. 635d9cef94SEvan Lloydtab_width = 4 645d9cef94SEvan Lloyd 65*40b06510SJustin Chadwell 66*40b06510SJustin Chadwell# Adjustment for python which prefers a different style 67*40b06510SJustin Chadwell[*.py] 68*40b06510SJustin Chadwell# [PEP8] Indentation 69*40b06510SJustin Chadwell# "Use 4 spaces per indentation level." 70*40b06510SJustin Chadwellindent_size = 4 71*40b06510SJustin Chadwellindent_style = space 72*40b06510SJustin Chadwell 73*40b06510SJustin Chadwell# [PEP8] Maximum Line Length 74*40b06510SJustin Chadwell# "Limit all lines to a maximum of 79 characters." 75*40b06510SJustin Chadwellmax_line_length = 79 76