Trailing spaces in markdown files are not detected by this project's "Check Code" job

Created on 27 August 2025, 22 days ago

Problem/Motivation

Trailing spaces in .md files are not checked and reported by this project's "Check Code" job. Trailing spaces are reported by some of the other code quality and linting jobs, and it is general best practice to avoid trailing spaces.

Whilst there is not yet any agreed coding standard for Markdown files, the Drupal Coding Standards projects are discussing the topic:
#2191525: [PP-1][policy, no patch] Extend Markdown coding standards to support API module (DOXYGEN)
🌱 Adopt CommonMark spec for Markdown files Needs work
🐛 Conflict between coding standards and module documentation guidelines on file naming RTBC

However, it would benefit this project if we detected and prevented trailing spaces. The problem occurs when making documentation edits using the web UI (which is useful as it gives a realtime preview). Trailing spaces are hard to detect and can be commited without knowing. Then when the doc page is edited locally or in other editors, where trailing spaces are stripped automatcally, we get unintended and unrelated changes.

Proposed resolution

Investigate if .md files can be included in one of the other code quality/linting jobs that this project runs on it's own files. This is not a proposal to add the solution to the Contrib jobs (at least, not initially)

Remaining tasks

📌 Task
Status

Active

Component

gitlab-ci

Created by

🇬🇧United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024