All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: rsbecker@nexbridge.com
Cc: git@vger.kernel.org
Subject: Re: Automatic code formatting
Date: Mon, 11 Jul 2022 00:58:30 +0000	[thread overview]
Message-ID: <Yst1tmpBU0DHdi5P@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <006c01d894aa$3b9f33b0$b2dd9b10$@nexbridge.com>

[-- Attachment #1: Type: text/plain, Size: 3586 bytes --]

On 2022-07-10 at 22:13:01, rsbecker@nexbridge.com wrote:
> 
> Being one of the platforms that will be specifically excluded from
> this proposal, I would like to offer an alternative. Before that,
> please remember that not everything is Linux. My suggestion is to
> create infrastructure to automatically format on add/commit. This
> could be pluggable relatively simply with clean filter that is
> language specific - perhaps with a helper option that installs the
> formatter easily (because clean filters are notoriously painful to
> install for newbies from my observations). It would be nice to have
> something in perl that is more portable and pervasive than clang -
> although perl could launch clang where available. I think having
> infrastructure for code formatting that is built into git is actually
> highly desirable - assuming that it is not unduly difficult to install
> those. It would extend beyond git contributions, but the contributors
> could be told (Contributor's Guide) that then need to follow standard
> X, which may very well be clang format. There are java formatters, php
> and perl formatters, even COBOL and TAL formatters. My position is
> that having a standard way to plug these in is a more general plan
> that would reach a larger community. Git contributions could then just
> leverage standard git functionality.

I am willing to acknowledge the fact that not everybody has clang on their
preferred platform.  However, I assume you do have a laptop or desktop
with which you access your platform (since I believe it's a server
platform) and that you can install software there, or that you have the
ability to run some sort of virtualization framework on some system.

I am in general not very willing to say that we can't use or have useful
developer tools because of uncommon platforms.  Linux, Windows, macOS,
and (I believe) FreeBSD, NetBSD, and OpenBSD all support clang and
related tools, and I don't think it's unreasonable for us to expect that
someone can have access to such a system as part of development, even if
that's in a VM.  Those six operating systems plus Chrome OS constitute
the overwhelming majority of desktop and laptop systems, and there are
several options which are free (both as in speech and beer).

Moreover, clang and LLVM are extremely portable[0].  As a practical
matter, any platform wanting to support software written in Rust (a
popular and growing language) will likely need LLVM, and there is also a
lot of software in C and C++ that only supports GCC-compatible
compilers.  I do feel that providing support for modern toolchains is an
important part of providing a viable OS port, and that we should be able
to rely on porters for that OS to do that work.  I realize that LLVM is
not yet ported to your system, but I believe it's going to functionally
need to happen sooner or later.  When it does, you'll be able to send
patches directly without needing to copy to another OS to format the
code.

I should point out that I'm very willing to accept less common platforms
or architectures as build targets provided they can support the 2008
version of POSIX (which was released 14 years ago) reasonably well.  I
feel strongly that we should continue to support such systems for the
indefinite future to the best of our abilities.

[0] LLVM supports targeting 18 Debian architectures under Linux, Haiku,
VXWorks, Fuchsia, UEFI, WebAssembly, NVidia CUDA, the Nintendo 3DS, and
more.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2022-07-11  0:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 21:50 Automatic code formatting brian m. carlson
2022-07-10 22:08 ` Junio C Hamano
2022-07-10 22:13 ` rsbecker
2022-07-11  0:58   ` brian m. carlson [this message]
2022-07-11  1:28     ` rsbecker
2022-07-11 16:53       ` Elijah Newren
2022-07-11 20:15         ` Ævar Arnfjörð Bjarmason
2022-07-11 21:19           ` Elijah Newren
2022-07-11 11:37 ` [RFC PATCH 0/4] make headway towards a clean "clang-format" Ævar Arnfjörð Bjarmason
2022-07-11 11:37   ` [RFC PATCH 1/4] Makefile: add a style-all targets for .clang-format testing Ævar Arnfjörð Bjarmason
2022-07-11 11:37   ` [RFC PATCH 2/4] .clang-format: Add a BitFieldColonSpacing=None rule Ævar Arnfjörð Bjarmason
2022-07-11 22:42     ` brian m. carlson
2022-07-11 22:52       ` Junio C Hamano
2022-07-12  6:56       ` Ævar Arnfjörð Bjarmason
2022-07-11 11:37   ` [RFC PATCH 3/4] .clang-format: do not enforce a ColumnLimit Ævar Arnfjörð Bjarmason
2022-07-11 21:37     ` Junio C Hamano
2022-07-12  7:03       ` Ævar Arnfjörð Bjarmason
2022-07-11 22:39     ` brian m. carlson
2022-07-11 22:46       ` Junio C Hamano
2022-07-11 23:05         ` Eric Sunshine
2022-07-11 23:30           ` Junio C Hamano
2022-07-11 11:37   ` [RFC PATCH 4/4] .clang-format: don't indent "goto" labels Ævar Arnfjörð Bjarmason
2022-07-11 21:04     ` Junio C Hamano
2022-07-12  6:55       ` Ævar Arnfjörð Bjarmason
2022-07-11 13:17 ` Automatic code formatting Phillip Wood
2022-07-11 13:21   ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yst1tmpBU0DHdi5P@tapette.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.