Quote consistency in .info.yml files for Core modules

Created on 24 August 2018, over 6 years ago
Updated 3 August 2024, 4 months ago

Problem/Motivation

While evaluating and researching core modules, it was noticed that are a few inconsistencies in .info.yml files, specifically, the use of single and double quotes around titles and descriptions.

Analysis:

Modules with one word titles (with no quotes): 41
Modules with one word titles (with single quotes): 2
Modules with multiple word titles (with single quotes): 22
Modules with multiple word titles (with no quotes): 9
Description (with single quotes): 67
Description (with no quotes): 3
Description (with double quotes): 1

Proposed resolution

Update modules to have the following:

Standards proposal for name and description values:

  • The first character in the name value is a letter or underscore.
  • Name and description have to be resolved to strings by Yaml.
  • Single quoting of values is allowed in some cases. (see below)
  • Double quoting of values is not allowed.
  • The value mapping indicator (:) should be followed by a single space.

In the following cases, use single quoting:

  • Value contains a : followed by a <space> or a # preceded by a <space>.
  • Value contains any of the following characters with or without a preceding colon: { } [ ] <comma>
  • Values matches completely with any of these: true false yes no y n on off null ~
  • Value starts with any of these characters: ! & * { } [ ] , # | > @ ` " \ ' <space> %
  • Value starts with a ?, : or - followed by a <space>.

See also https://www.drupal.org/docs/creating-custom-modules/let-drupal-know-abou... β†’

Remaining tasks

Create an issue in the Coding Standards project to decide what the standard format should be.

  1. Clarify what the standards are.
  2. Write tests to prevent issue from occurring in the future as new or experimental modules are added to core.
  3. Edit Drupal documentation pages to explain standards.

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States volkswagenchick San Francisco Bay Area

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024