git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:02 UTC

Re: [PATCH 1/8] CodingGuidelines: instruct to name arrays in singular

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 19, 2026, 03:29 UTC
Message-ID
<CAPig+cRHm1vDABoHNKiuBRRsvk90Z1qGeeu3DT3VHdzEfJeP=g@mail.gmail.com>
In-Reply-To
<20260218211845.96009-2-lucasseikioshiro@gmail.com>

On Wed, Feb 18, 2026 at 4:20 PM Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> wrote:

Show 19 quoted lines
> Arrays should be named in the singular form, ensuring that when
> accessing an element within an array (e.g. dog[0]) it's clear that
> we're referring to an element instead of a collection.
>
> Add a new rule to CodingGuidelines asking for arrays to be named in
> singular instead of plural.
>
> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
> ---
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> @@ -656,6 +656,14 @@ For C programs:
> + - Array names should be named in the singular form. E.g.:
> +
> +         char *dog[] = ...;
> +
> +   and not:
> +
> +         char *dogs[] = ...;
> +

While this is generally true on this project, it is nevertheless incomplete. More specifically, the singular form is used for an array name in cases when the individual items of the array are the typical subject of use, for instance, when the consumer of the array is walking the dogs one at a time. However, there are cases in which the array is generally employed as a whole, rather than as its unit parts, in which the plural form for the name is preferable. An example would be when walking all the dogs at the same time.

Previous: Lucas Seiki OshiroNext: Patrick Steinhardt
Message 10 of 24 in “repo: refactoring leftover nits”
  1. 0/8 repo: refactoring leftover nitsLucas Seiki Oshiro, Feb 18, 2026
  2. 1/8 CodingGuidelines: instruct to name arrays in singularLucas Seiki Oshiro, Feb 18, 2026
  3. 2/8 repo: rename repo_info_fields to repo_info_fieldLucas Seiki Oshiro, Feb 18, 2026
  4. 3/8 repo: replace get_value_fn_for_key by get_repo_info_fieldLucas Seiki Oshiro, Feb 18, 2026
  5. 4/8 repo: rename struct field to repo_info_fieldLucas Seiki Oshiro, Feb 18, 2026
  6. 5/8 t1900: rename t1900-repo to t1900-repo-infoLucas Seiki Oshiro, Feb 18, 2026
  7. 6/8 t1901: use tr in git repo structure output instead of expected valueLucas Seiki Oshiro, Feb 18, 2026
  8. 7/8 Documentation/git-repo: replace 'NUL' with '_NUL_'Lucas Seiki Oshiro, Feb 18, 2026
  9. 8/8 Documentation/git-repo: capitalize format descriptionsLucas Seiki Oshiro, Feb 18, 2026
  10. Eric SunshineFeb 19, 2026
  11. Patrick SteinhardtFeb 20, 2026
  12. Lucas Seiki OshiroFeb 22, 2026
  13. Lucas Seiki OshiroFeb 22, 2026
  14. 0/8 repo: refactoring leftover nitsLucas Seiki Oshiro, Feb 25, 2026
  15. 1/8 CodingGuidelines: instruct to name arrays in singularLucas Seiki Oshiro, Feb 25, 2026
  16. 2/8 repo: rename repo_info_fields to repo_info_fieldLucas Seiki Oshiro, Feb 25, 2026
  17. 3/8 repo: replace get_value_fn_for_key by get_repo_info_fieldLucas Seiki Oshiro, Feb 25, 2026
  18. 4/8 repo: rename struct field to repo_info_fieldLucas Seiki Oshiro, Feb 25, 2026
  19. 5/8 t1900: rename t1900-repo to t1900-repo-infoLucas Seiki Oshiro, Feb 25, 2026
  20. 6/8 t1901: adjust nul format output instead of expected valueLucas Seiki Oshiro, Feb 25, 2026
  21. 7/8 Documentation/git-repo: replace 'NUL' with '_NUL_'Lucas Seiki Oshiro, Feb 25, 2026
  22. 8/8 Documentation/git-repo: capitalize format descriptionsLucas Seiki Oshiro, Feb 25, 2026
  23. Lucas Seiki OshiroFeb 25, 2026
  24. Junio C HamanoFeb 25, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.