Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1896417ybt; Thu, 2 Jul 2020 17:19:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB4xVpYSO6q0ZGuStPIIKap8+rhN0kk7+DAOsllxZ0r9Qckc1dmHRgYgFV1spRuZJ0DT0w X-Received: by 2002:aa7:c887:: with SMTP id p7mr23527491eds.240.1593735550790; Thu, 02 Jul 2020 17:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593735550; cv=none; d=google.com; s=arc-20160816; b=kEl9hh6qv/1fzke7lE3fm1D1pwS2yjA9/K2MrsGUKLLb0hgg2WZNZGtztSBflleM8S +1YzVVhT9KEOcliiomXylIYbz/GyH+e0fp8+Pmf2nYaOn7RKdyItFD//Slx+C7XzoG5Z BM5HY6jANgBHa9yyoZGSE7VWiFzZq1BlOcol6bT32u6bwK9gzT75NkDudp2CzQ03/zYU kZKORcIuy6jQGRdm4i4OwFt2xkQNk1u1EkwVKNNcknJMz70Yu1xjSGDOjngkjmYAqblr OKFadzX1FY+j7trEkzbSVKa7PPYK8RhvriQQK3qhMn9roK+UnxRuQGMfL5Tyq7DiPxAh ySXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=wrs3v8MjlP7Q7VWVUBiPauQHIjP2v+W5WpNE+Fx1jr0=; b=XpiFoT6OkljfI6v1tCfFmU4zjQKkoqDoGqpXxPbQoKi8AjbF5u7TsDUwRTnhYuu3kI IbTBwQ31IslLtkyxX3qft+yS2PhO4yO/Gf2r02RflowlbcNrSuutbyavw+FzSLF6UTcL mdg0t5jbsULxtz/HNc3KWLrKeO1hsuKlhLLW2kS857EkX8AuJu7Lc6+a6PgSljsMWgzb t8nqFEFV8igUFKGXiUF5iEHXicasosPCKhTAs4IaRFTdDxxMMxolYpGUdXrvYGa9m6d9 pnMnhj/k2k3mAbvBPSTHGpIWI5uR0Hx7Hr2ds3RMvFc2swgaywcloJEuWFeYu7qK4rsU cjJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kdrag0n.dev header.s=fm1 header.b=QmHrRP93; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=QVHDchzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kdrag0n.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si6569862ejb.157.2020.07.02.17.18.46; Thu, 02 Jul 2020 17:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kdrag0n.dev header.s=fm1 header.b=QmHrRP93; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=QVHDchzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kdrag0n.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726336AbgGCAP6 (ORCPT + 99 others); Thu, 2 Jul 2020 20:15:58 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41887 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbgGCAP6 (ORCPT ); Thu, 2 Jul 2020 20:15:58 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 16A715C01B3; Thu, 2 Jul 2020 20:15:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 02 Jul 2020 20:15:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kdrag0n.dev; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=wrs3v8MjlP7Q7VWVUBiPauQHIj P2v+W5WpNE+Fx1jr0=; b=QmHrRP93lCvRfYB7/Ss2D39q/EzHksHTyIAuRohyJf n5Q17uqzFO/aWUetejLkqnBpLvt62nGVQL5fjeblGY7+tcAwMWTbQJIBC6A1x+jg FM+It5HzgO83yToQn/PjmDOd98jKrIE7J8/RmRytDsCFN7W25Rz9rLtwHOGjzfQM RvvmUAWWNXWg479JBlZWUjKMYxbQlvr7zvEG/H/4BJ10V/Pyx+ZMQ84y80l5gR9D sUf0q9bPQIj5Y9rz/0cuq9vjHFMiM4XkKZzffq8OEev+rzTaxEaio1E1ySPZigJn aiIlGYZ8DAjCl0/6zr0ump5lAyRiPo0G+oLeI1Tykofw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=wrs3v8MjlP7Q7VWVU BiPauQHIjP2v+W5WpNE+Fx1jr0=; b=QVHDchzg74wDWP4YCGPYs5Fxn2XiIT1yO 947bOR8nv1Mvop38V7TMdOPS6tZM5pGXLFgw5Q/hV20GjdMN6Qdyzs4P9F83CDKK LMDnszsx1JQyDAB1t5LeLqUsLToN/T8PCot747fsOkVN+q3H1wJy12+78YriQcc+ hJdMdP5XYqs9O45I6ZhNXTMSGqb1HF2UZuZ2U5kJ8tHQfD4fuQshmmef5Z5nnh9s RTLSl0dv1kYic0O8dZTpmk6mWv3ohaLlkJjwyiOzWzn4kHt/U4UEnljd/RIb+HTD HHAypE2DhDamFrf9zyc03z/VNUh2CljS5vTqQN6UXfHszTyGhRpcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdehgdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepffgrnhhnhicunfhi nhcuoegurghnnhihsehkughrrghgtdhnrdguvghvqeenucggtffrrghtthgvrhhnpeekke efkeelgfetvdekvedtffefudetveeuheefhfeikeevveetgeekhffgueegheenucffohhm rghinhepvgguihhtohhrtghonhhfihhgrdhorhhgnecukfhppeejfedrvddvhedrgedrud efkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu rghnnhihsehkughrrghgtdhnrdguvghv X-ME-Proxy: Received: from pinwheel.hsd1.wa.comcast.net (c-73-225-4-138.hsd1.wa.comcast.net [73.225.4.138]) by mail.messagingengine.com (Postfix) with ESMTPA id A4F6A3280059; Thu, 2 Jul 2020 20:15:55 -0400 (EDT) From: Danny Lin To: Andrew Morton Cc: Andy Whitcroft , Joe Perches , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Danny Lin Subject: [PATCH] editorconfig: Add automatic editor configuration file Date: Thu, 2 Jul 2020 17:12:12 -0700 Message-Id: <20200703001212.207565-1-danny@kdrag0n.dev> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org EditorConfig is a standard for defining basic editor configuration in projects. There is support available for 47 code editors as of writing, including both built-in and extension support. Many notable projects have adopted the standard already, including zsh, htop, and qemu. While this isn't a full-fledged C code style specifier, it does set some basic ground rules that make it more convenient for contributors to use any editor of their choice and not have to worry about indentation, line endings, encoding, final newlines, etc. This should make it significantly easier to conform to the kernel's general code style when used in combination with clang-format. For more information, check the official EditorConfig website: https://editorconfig.org/ Signed-off-by: Danny Lin --- .editorconfig | 16 ++++++++++++++++ .gitignore | 1 + Documentation/process/4.Coding.rst | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..580d2e90d855 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 +# Linux kernel EditorConfig file (https://editorconfig.org/) + +# Located at the project root +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +indent_style = tab +indent_size = 8 + +# This avoids introducing too many unnecessary changes in trivial commits +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 87b9dd8a163b..956bcc3c9d76 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,7 @@ modules.order # !.clang-format !.cocciconfig +!.editorconfig !.get_maintainer.ignore !.gitattributes !.gitignore diff --git a/Documentation/process/4.Coding.rst b/Documentation/process/4.Coding.rst index 13dd893c9f88..c5c46bcafdad 100644 --- a/Documentation/process/4.Coding.rst +++ b/Documentation/process/4.Coding.rst @@ -66,6 +66,12 @@ for aligning variables/macros, for reflowing text and other similar tasks. See the file :ref:`Documentation/process/clang-format.rst ` for more details. +Some basic editor settings, such as indentation and line endings, will be +set automatically if you are using an editor that is compatible with +EditorConfig. See the official EditorConfig website for more information: + +https://editorconfig.org/ + Abstraction layers ****************** -- 2.27.0