Skip to content

Add a warning for consecutive duplicate words - #45497

Closed
raulkolaric wants to merge 1 commit into
github:mainfrom
raulkolaric:feature/consecutive-duplicate-words-linter
Closed

Add a warning for consecutive duplicate words#45497
raulkolaric wants to merge 1 commit into
github:mainfrom
raulkolaric:feature/consecutive-duplicate-words-linter

Conversation

@raulkolaric

Copy link
Copy Markdown
Contributor

Why:

Closes:

Recent documentation fixes removed consecutive duplicate words that are difficult to notice during review:

Together, these PRs corrected 11 duplicated words across 11 files. A content-linter rule can identify this pattern earlier and prevent similar mistakes from reaching the documentation.

What's being changed (if available, include any code snippets, screenshots, or gifs):

This PR adds GHD068, consecutive-duplicate-words.

The rule:

  • Checks Markdown prose for consecutive duplicate words, case-insensitively.
  • Covers headings, paragraphs, lists, blockquotes, links, tables, and sentence-like prose in text code fences.
  • Reports the second occurrence with its exact line and column.
  • Ignores inline code, non-text code fences, punctuation-separated words, and mixed-case placeholder or operator pairs such as OR or and hostname HOSTNAME.
  • Runs as a warning because some repetitions may be intentional.
  • Uses the message: Check whether the repeated word "<word>" is intentional.
  • Does not automatically modify content.
  • Supports partial Markdown and lintable YAML content.

Historical validation found all 11 duplicates corrected by PRs #45476 and #45488:

Revision Files scanned Before fix After fix
#45476 1 1 warning 0
#45488 10 10 warnings 0

The historical findings included use use, more more, the the, Chat chat, Storage storage, and to to inside a text fence.

Validation performed:

  • npm run build
  • npm run tsc
  • npm run lint
  • npm run prettier-check
  • Focused unit tests: 7 passed
  • Full repository scan
  • Historical scan against the pre-fix revisions

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
contributing/collaborating-on-github-docs/using-the-content-linter.md fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17
fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17
from reusable

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:

  • src/content-linter/lib/linting-rules/consecutive-duplicate-words.ts
  • src/content-linter/lib/linting-rules/index.ts
  • src/content-linter/style/github-docs.ts
  • src/content-linter/tests/unit/consecutive-duplicate-words.ts

You'll need to revert all of the files you changed that match that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

The complete list of files we can't accept are:

  • .devcontainer/**
  • .github/**
  • data/reusables/rai/**
  • Dockerfile*
  • src/**
  • package*.json
  • content/actions/how-tos/security-for-github-actions/security-hardening-your-deployments/**

We also can't accept contributions to files in the content directory with frontmatter contentType: rai.

@subatoi

subatoi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@raulkolaric Thank you very much for your thoughtfulness here; however, unfortunately as you'll have seen from the failing check, we're unable to accept non-content-related contributions. Your recent contributions have been really valued, so please do feel free to keep sending similar; however, I'm afraid on this occasion I can only close this one out 🙇

@subatoi subatoi closed this Aug 13, 2026
@raulkolaric

Copy link
Copy Markdown
Contributor Author

@subatoi Sorry about the invalid PR! This was an idea I had after my first contribution, and I implemented it without checking the contribution guidelines first 😆

Would it be appropriate to open an issue suggesting this feature instead, or is this kind of linting not the best approach for this repository? I’m new to open source and still figuring things out, so I’d really appreciate your input. Thank you!

@subatoi

subatoi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@raulkolaric No problem! In general yes, we'd advise that you open an issue; however, I'd recommend having a browse at https://docs.github.com/en/contributing first, as it describes what we can and can't accept. Essentially, we can only accept content changes from contributors in this repo, so any sort of linter changes (for example) would be automatically rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants