public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Add linting checks to 'make check'
@ 2023-05-19 12:13 Carlos O'Donell
  2023-05-19 12:13 ` [PATCH 1/1] Add lint-makefiles Makefile linting test Carlos O'Donell
  2023-05-19 16:55 ` [PATCH 0/1] Add linting checks to 'make check' Joseph Myers
  0 siblings, 2 replies; 8+ messages in thread
From: Carlos O'Donell @ 2023-05-19 12:13 UTC (permalink / raw)
  To: libc-alpha, Noah Goldstein, Adhemerval Zanella, Florian Weimer
  Cc: Carlos O'Donell

We have some existing linting checks in scripts/ around the specifics of
the installed headers, but nothing specifically about the sources for
glibc. Since this is the first time I see myself plumbing $(srcdir) down
into a test, and then using it in that test,  I think we should have a
discussion around this patch to see if we as developers consider it
acceptable to lint the Makefile format in 'make check' itself. The check
needs to run the python interpreter about 200 times, but it's fairly
fast and on a slow system takes ~3s. My gut feeling is that basic
linting checks could go into 'make check', but anything more complicated
would have to live in pre-commit CI. Deciding what is "basic" is going
to have to be evaluated on an ongoing basis and with input from what
developers consider too slow or onerous for 'make check'.

I want to make the case here for basic linting because it provides
immediate and positive feedback to new contributors of the project that
they have made a mistake in writing their Makefile. This is even better
than pre-commit CI linting; which you often want to run locally anyway.

I don't think we should stop here. I think we should take Noah's
.clang-format and hammer it into a lint for 'make check' that covers all
source files that we know we want formatted a particularly way and keep
expanding that. This would likely have to run in pre-commit CI, but we
would keep all the test infrastructure in scripts/ or the project tree
itself with a special make target.

On that note, we could add a special target for this e.g. make lint,
and run that in pre-commit CI. For now I'm suggesting we adopt a small
Makefile linting pass in 'make check', but the options to change this in
the future are open.

Carlos O'Donell (1):
  Add lint-makefiles Makefile linting test.

 Makefile                  |  6 +++++
 scripts/lint-makefiles.sh | 47 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 scripts/lint-makefiles.sh

-- 
2.40.0


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

end of thread, other threads:[~2023-05-30 12:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 12:13 [PATCH 0/1] Add linting checks to 'make check' Carlos O'Donell
2023-05-19 12:13 ` [PATCH 1/1] Add lint-makefiles Makefile linting test Carlos O'Donell
2023-05-19 12:35   ` Alejandro Colomar
2023-05-19 12:45     ` Florian Weimer
2023-05-23 14:05       ` Carlos O'Donell
2023-05-30 12:10       ` Carlos O'Donell
2023-05-19 16:55 ` [PATCH 0/1] Add linting checks to 'make check' Joseph Myers
2023-05-23 12:54   ` Carlos O'Donell

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 read-only IMAP folder(s) and NNTP newsgroup(s).