# Linting Both Prose and Embedded Code with RuboCop

DevFeed: [Linting Both Prose and Embedded Code with RuboCop](<https://devfeed.tech/articles/linting-both-prose-and-embedded-code-with-rubocop-122102.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/11/06/linting-both-prose-and-embedded-code-with-rubocop.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-11-06T00:00:00Z

Content type: article

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Markdown](<https://devfeed.tech/topics/markdown.md>), [Static code analysis](<https://devfeed.tech/topics/static-code-analysis.md>), [generative-ai-tools](<https://devfeed.tech/topics/generative-ai-tools.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [linter](<https://devfeed.tech/tags/linter.md>), [linting](<https://devfeed.tech/tags/linting.md>), [markdown](<https://devfeed.tech/tags/markdown.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [options](<https://devfeed.tech/tags/options.md>), [port](<https://devfeed.tech/tags/port.md>), [release](<https://devfeed.tech/tags/release.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [style](<https://devfeed.tech/tags/style.md>), [testing](<https://devfeed.tech/tags/testing.md>), [usability](<https://devfeed.tech/tags/usability.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

The author introduces rubocop-prose to lint Markdown and plain text alongside embedded Ruby using RuboCop. Install and enable rubocop-md, rubocop-prose, and rubocop-spellcheck; then run `bundle exec rubocop`. rubocop-prose checks document structure, whitespace, and YAML front matter, with configurable editorial rules. rubocop-spellcheck checks prose, comments, and strings using an American English dictionary and supports project vocabulary; Ruby identifier checks are optional. rubocop-md checks Ruby in explicitly tagged Markdown code blocks when autodetection is disabled, leaving other languages alone. Safe autocorrection can join wrapped paragraphs while preserving intentional hard breaks. The generated spelling dictionary should be reviewed before committing because it will accept remaining typos. The excerpt notes that proposed Markdown rules were rejected from rubocop-md as out of scope: that plugin lints Ruby within Markdown, not Markdown itself.

## Source excerpt

My father is a poetry translator, so perhaps my obsession with prose runs in the family. This started before Markdown: I wrote rubocop-exception_messages after noticing inconsistent exception messages in Grape. After I replaced this blog's Python spell checker with a RuboCop plugin I still had a Node installation to check Markdown. Since it's a Jekyll blog, and the build is Ruby, the spelling checker is Ruby, and my default set of code examples are also Ruby, why was formatting the README Node.js? I first tried extending rubocop-md, proposing prose checks and parser diagnostics, a reusable Markdown parser, hidden cop-directive fixes, front-matter handling, and preserving prose alongside Ruby corrections. The parser and interoperability work were merged in #57, but the proposed markdownlint rules were rejected out of scope because rubocop-md lints Ruby within Markdown, not Markdown itself. Introducing rubocop-prose, a RuboCop plugin for Markdown and plain text. I also replaced this blog's Markdown linter with it. It's an AI-assisted port from JavaScript markdownlint and Ruby markdownlint, my custom single-line-paragraphs rule, rubocop-md, and rubocop-spellcheck, plus ideas from upstream issues, pull requests, and forks. I burnt 11.4 million input and 2.4 million output non-cached tokens for development, publishing the initial release in 16 hours, and iterating to 0.2.0 over the next 2 days. My workflow was to start from scratch, then have AI write the PRs, and always steer: reviewing behavior, questioning defaults, and simplifying the user-facing settings by reading PR descriptions and generated documentation. I barely read code as I mostly cared about usability of the linter. For example, I asked to merge EnforcedStyle and Style. That meant consolidating overlapping options, considering a breaking change, and aligning names across cops. Adding Prose to RuboCop Add to your Gemfile: gem 'rubocop-md', '~> 3.0', require: false gem 'rubocop-prose', '~> 0.2.0', require: f