Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp78119ybe; Thu, 12 Sep 2019 16:02:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaeBWiip5cqPBLKq8VJy1IF1UV4Qj1GEHMw8KW3R53TEtgKkwqJCJ4HH1T5ZHw5pE/9//J X-Received: by 2002:aa7:d605:: with SMTP id c5mr8312001edr.232.1568329335298; Thu, 12 Sep 2019 16:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568329335; cv=none; d=google.com; s=arc-20160816; b=lWr7ok7UejYeWeoGZa8CT9ZoaGtufrDpb4l9LFSkatZx/x7pwN+6xjp7GVrlgrsQlv RFsWpBb6Kg7HK8GHa9nrYfdCphG47cbc4QLhIKMgJJa71cVeouMGPD4eAGX8MVECs0jq Xyhd1BS+n3f2YdBAepCJkhQts8nmxMNk4elGWyQ6hbQ/gA/x5Vwmhe20WSEoHAraEL9c S3E5Xliw2SEByD59EWx/Uv0tQ2HsPP/8v7lZPAk8dOn17Fv9q/9bp/DMs2zySHLGhNEG fIy4dOf+J14e5mG0d6qHUVpLzHgGtXwADYFvAWy9JlLaM0hrjy1e4Wp2k7niLSguwoFv BRwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QtcuvnqG4r2YqI4zyIzKkMUs7uL0jyuefwghC3YKW8k=; b=pvl8qdHLLuaje4fh31nR4qzp51QoZlOMUTvnvH77oy1LDyH2meWIdWEKXz9D0vNod5 gtfsuWs04cHzrXYF6pctD73dbfBjAerjq1rqeMT8I/c1XeYOmyZAJAmPIjxtyw521M5H jtP+DkJL+rG7N9FjnvDjFUeYgoHGYCGkBHGNXDtXGBFG3y+YovF5qmlQUHcVjB7QyYMF cRRA/sMPs9+ewEU7EeHp6lqs5S6nhpMi2Wf6vZOnmleFDaE54bn0f9NpE1ySsfycjl1+ zlxPhxXcF3qiZwo+UEhscbzi4NQpcMwytjGJ6LX3cBXImtEvzNRTpHjEOmoFN2XbWAus 0fTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lQCZxf2w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si6510696ejk.376.2019.09.12.16.01.49; Thu, 12 Sep 2019 16:02:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lQCZxf2w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbfILW63 (ORCPT + 99 others); Thu, 12 Sep 2019 18:58:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44253 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbfILW63 (ORCPT ); Thu, 12 Sep 2019 18:58:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id q21so16868811pfn.11 for ; Thu, 12 Sep 2019 15:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QtcuvnqG4r2YqI4zyIzKkMUs7uL0jyuefwghC3YKW8k=; b=lQCZxf2wWj/TD7i+zM4x52/vcGK5ifsJjrjavtQIbd5PmjztGeExGDQxomnWHrphOB D/b/4Xm2CTnyaPHy4dZUJ3v7HBtU4EwyETt2D2kuo5QIp0uH52f7JYTDWDsLOI/ra7wo y2ug9CJE1vVyWHHyERvCW1WG/VwSFT0QTlVjDmHRrNl6zJ84sUCcXEkrKgWQpbt3/vtH bap3kGRCKwkycQUg8DMdT2aCQwUuPvJc7KvoQGGxEbD1nusDY2UowCwEy8SjbrSV+l8Y 38Yy7ebxD1Kjv9rfsY98KICrdYKwehq1d+xx++tGhXaZog4YEDqokAuJ6C+q3tyKeHmw V66w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QtcuvnqG4r2YqI4zyIzKkMUs7uL0jyuefwghC3YKW8k=; b=dducNfZq/vc3RQ0ePrTQzlzlH2GE7pYtV1eO+VfPOZhf884SWptcavs3+HGa6suRY1 rFNsJaYNn1BuIj/qJtQwVxk45kFaiTBRVxNZTG+1Z6R+LQIgZhzQhXOBZJpKlb9Xau5G SvyCa0+lHJufPgDZGDR2XbUY1p7q8zzIFggP+3KqAvH2KZJLqOoSEqHgVdtflk7AvK6C uTdsatkMzvzp3jQk8tuLeyZgtWQrvSllbYlxKgCUemtQ9gyks+fajMg0NxFzDq/h7SJb 9YhG5aSYaK9uTbbQOBBqGtEUUMPw2HmqS1anHXJudMZtczeF4wp8ZDVM0BnmTKB0z192 Yxcw== X-Gm-Message-State: APjAAAV4IPCDe9qjnLU9JD7u8o1Wat883c0WN/qgyDY8PNmABNCAF28l cRBcZtZTeGWEM46+RASlT4sLEm4yDrvvdGPIkK2uLw== X-Received: by 2002:a62:5fc1:: with SMTP id t184mr19502919pfb.84.1568329108004; Thu, 12 Sep 2019 15:58:28 -0700 (PDT) MIME-Version: 1.0 References: <4df0a07ec8f1391acfa987ecef184a50e7831000.camel@perches.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 12 Sep 2019 15:58:16 -0700 Message-ID: Subject: Re: [PATCH 00/13] nvdimm: Use more common kernel coding style To: Miguel Ojeda Cc: Joe Perches , Jeff Moyer , Dan Williams , linux-nvdimm , linux-kernel , Dan Carpenter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 12, 2019 at 2:58 PM Miguel Ojeda wrote: > > On Thu, Sep 12, 2019 at 11:08 PM Joe Perches wrote: > > > > Please name the major projects and then point to their > > .clang-format equivalents. > > > > Also note the size/scope/complexity of the major projects. > > Mozilla, WebKit, LLVM and Microsoft. They have their style distributed > with the official clang-format, not sure if they enforce it. > > Same for Chromium/Chrome, but it looks like they indeed enforce it: > > "A checkout should give you clang-format to automatically format C++ > code. By policy, Clang's formatting of code should always be accepted > in code reviews." > > I would bet other Google projects do so as well (since Chandler > Carruth has been giving talks about clang-format for 7+ years). Nick? So Google3 (the internal monorepo that Android, Chromium, ChromiumOS, Fuchsia are not a part of) is pretty sweet. You cannot even post code unless the linter has been run on it (presubmit hook), which for our ~350 millions LoC of C++ is clang-format. If you bypass local presubmit hooks, our code review tool ("critique") won't let you submit code that fails lint presubmit checks. I suspect the initial conversion was probably committed by bots. > > I hope those are major enough. There is also precedent in other > languages (e.g. Java, C#, Rust). Yep! Other people coming to C/C++ from these languages find the discussion about tabs vs spaces to be highly entertaining! When you have an automated code formatter and an agreed upon coding style (and hopefully enforcement), you save so much time from avoided bikesheds! Don't like the codebase's coding style? Then write the code how you like and just run the formatter when you're done (might not help with conventions though, maybe that's where checkpatch.pl can shine). Done! No more wasted time on what color to paint the bikeshed! -- Thanks, ~Nick Desaulniers