mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de, Bruno Thomsen <bruno.thomsen@gmail.com>,
	Markus Heidelberg <M.Heidelberg@cab.de>
Subject: Re: [ptxdist] [PATCH] templates: update vim modeline for makefile and kconfig files
Date: Fri, 25 Jul 2025 16:42:15 +0200	[thread overview]
Message-ID: <20250725144215.GJ249918@pengutronix.de> (raw)
In-Reply-To: <20250725-speculate-monogram-1c1c194e6937@thorsis.com>

On Fri, Jul 25, 2025 at 12:07:16PM +0200, Alexander Dahl via ptxdist wrote:
> Hello,
> 
> Am Fri, Jul 25, 2025 at 11:42:31AM +0200 schrieb Michael Olbrich:
> > On Thu, Jul 24, 2025 at 11:35:34AM +0200, Bruno Thomsen wrote:
> > > Den tors. 24. jul. 2025 kl. 09.51 skrev Markus Heidelberg <M.Heidelberg@cab.de>:
> > > >
> > > > On Wed, Jul 23, 2025 at 07:03:42PM +0200, Bruno Thomsen wrote:
> > > > > Den ons. 23. jul. 2025 kl. 09.11 skrev Michael Olbrich
> > > > > <m.olbrich@pengutronix.de>:
> > > > > >
> > > > > > On Wed, Jul 16, 2025 at 09:22:55PM +0200, Bruno Thomsen wrote:
> > > > > > > Setup sane editor default using vim modeline.
> > > > > > >
> > > > > > > sed -i "s/syntax=make/ft=make noet tw=72 ts=8 sw=8/g" rules/templates/*-make
> > > > > >
> > > > > > tw=72 is fine for the .in files. That will give a good flow for the help
> > > > > > text. Most of the rest will be shorter anyways.
> > > > > >
> > > > > > But the makefiles have longer lines. The banner above the stage are already
> > > > > > 78 chars wide and many of the variables at the top as well.
> > > > > > And for the rest, readability really depends  on the content and a defined
> > > > > > textwidth suggests a hard limit that I don't want to set.
> > > > > >
> > > > > > Maybe a soft visual limit with cc=80 instead?
> > > > >
> > > > > [...]
> > > > >
> > > > > Maybe drop tw on both and use cc=80 on kconfig (as you suggested)
> > > > > and cc=100 on makefiles?
> > > >
> > > > I don't think such a visual setting should be imposed on the user and
> > > > could annoy some, myself included ;)
> > > >
> > > > Is this a problem in practice that has to be tackled at all?
> > 
> > I do request more line-breaks when I review patches. It's not that often
> > that I think we need urgent changes. But defining a good default in some
> > way makes sense.
> > 
> > > Indentation and file format are my primary reasons for adding modeline.
> > > Make it much easier to work on when you switch between 5-10 formats
> > > each day.
> > 
> > So vim detect the file format for kconfig without any help. But I don't
> > mind adding it explicitly.
> 
> Not on my machine(s), at least not for files named 'package.in' like in
> ptxdist.  It does only set ft=kconfig automatically for files named
> 'Kconfig' like in the linux kernel source tree.
> 
> > For 'noet ts=8 sw=8' we could also create a editorconfig file. That would
> > work with more editors (with the appropriate plugins).
> 
> +1 for that.

Should probably look like this:
-------------------------
root = true

[*]
indent_style = tab
tab_width = 8
indent_size = 8
insert_final_newline = true
trim_trailing_whitespace = true

[*.sh]
indent_size = 4

[*.py]
indent_style = space
tab_width = 4
indent_size = 4
-------------------------

Michael

> > > Personally I like to have automation tell me when lines need to be broken,
> > > as it can generally give you a hit if you should refactor a code section for
> > > smaller indentation so it's easier to read.
> > 
> > Lets do tw=80 for the .in files and no width limit (for now) for the .make
> > files.
> 
> Ack.
> 
> Greets
> Alex
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2025-07-25 14:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 19:22 Bruno Thomsen
2025-07-17  6:31 ` Alexander Dahl via ptxdist
2025-07-23  7:11 ` Michael Olbrich
2025-07-23 17:03   ` Bruno Thomsen
2025-07-24  7:51     ` Markus Heidelberg via ptxdist
2025-07-24  9:35       ` Bruno Thomsen
2025-07-25  9:42         ` Michael Olbrich
2025-07-25 10:07           ` Alexander Dahl via ptxdist
2025-07-25 14:34             ` Michael Olbrich
2025-07-25 14:42             ` Michael Olbrich [this message]

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=20250725144215.GJ249918@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=M.Heidelberg@cab.de \
    --cc=bruno.thomsen@gmail.com \
    --cc=ptxdist@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox