git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rfd] a new core.whitespace class "\No newline at end of file"
@ 2025-10-08 17:39 Junio C Hamano
  2025-10-08 19:29 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2025-10-08 17:39 UTC (permalink / raw)
  To: git

It would be a good sized internship project to introduce a new
core.whitespace class that is about a file that ends in an
incomplete line (it would be way too big as a microproject, so I would
not add the #leftoverbits tag to this one).

The student needs to learn quite a lot of things, including

 - they need to study the diff machinery to learn how existing
   whitespace breakages are reported, in order to figure out how to
   add a new class of whitespace breakage;

 - they need to find a good name for this new class;

 - they need to study the apply machinery to learn how existing
   whitespace breakages are reported or corrected, in order to
   figure out how to add support for this new class.

Thoughts?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [rfd] a new core.whitespace class "\No newline at end of file"
  2025-10-08 17:39 [rfd] a new core.whitespace class "\No newline at end of file" Junio C Hamano
@ 2025-10-08 19:29 ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2025-10-08 19:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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

On 2025-10-08 at 17:39:13, Junio C Hamano wrote:
> It would be a good sized internship project to introduce a new
> core.whitespace class that is about a file that ends in an
> incomplete line (it would be way too big as a microproject, so I would
> not add the #leftoverbits tag to this one).
> 
> The student needs to learn quite a lot of things, including
> 
>  - they need to study the diff machinery to learn how existing
>    whitespace breakages are reported, in order to figure out how to
>    add a new class of whitespace breakage;
> 
>  - they need to find a good name for this new class;
> 
>  - they need to study the apply machinery to learn how existing
>    whitespace breakages are reported or corrected, in order to
>    figure out how to add support for this new class.
> 
> Thoughts?

I think this is a great idea.  I've noticed that many newer developers
are using VS Code, which I believe leaves off the trailing newline by
default.

I think most people on this list understand why having a newline at the
end of the file is valuable and have configured their editors
accordingly, but for less experienced developers, this kind of lint
could be useful to help visualize these problems and even catch them in
CI.  Possibly the documentation (say, the FAQ) could be updated to help
explain why this kind of whitespace breakage should be avoided as well.
-- 
brian m. carlson (they/them)
Toronto, Ontario, CA

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-08 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 17:39 [rfd] a new core.whitespace class "\No newline at end of file" Junio C Hamano
2025-10-08 19:29 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).