Conversation
WalkthroughAdds two new Sphinx extensions (inline Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@doc/_ext/colordot.py`:
- Around line 46-48: The color value is injected directly into the HTML string
(variable color used to build html and passed into nodes.raw), so escape it
before interpolation: import the html module and replace direct use of color
with html.escape(color, quote=True) (or validate/whitelist acceptable CSS color
tokens) so the generated html string is safe and won’t break when color contains
quotes or angle brackets.
In `@doc/_ext/designguide.py`:
- Around line 54-75: The directive interpolates user-provided values directly
into the HTML (see self.arguments[0],
self.options.get("token"/"label"/"usage"/"border")) causing potential
rendering/HTML injection issues; before building color_style and html, import
and use html.escape to escape color, token, label, usage and border values, then
use those escaped variables when constructing color_style and the html string
and return nodes.raw("", html, format="html"). Ensure you escape the value used
in the inline style (border and color) and the text nodes (token/label/usage) so
all user-supplied inputs are safely encoded.
In `@doc/_templates/about.html`:
- Around line 2-9: The three icon-only anchor elements (the one with
title="Documentation home" linking to {{ pathto(master_doc) }}, the one with
title="Dfetch website" linking to https://dfetch-org.github.io/, and the one
with title="Source on GitHub" linking to https://github.com/dfetch-org/dfetch)
need explicit accessible names: add an aria-label attribute (e.g.,
aria-label="Documentation home", aria-label="Dfetch website", aria-label="Source
on GitHub") or include visually hidden text inside each anchor so screen readers
announce meaningful link names instead of relying solely on title.
In `@doc/conf.py`:
- Around line 133-135: The docs currently load Font Awesome via the three CDN
URLs
("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/fontawesome.min.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/solid.min.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/brands.min.css")
causing an external runtime dependency; replace this by vendoring the Font
Awesome assets locally: add the fontawesome CSS and webfont files into the docs
static assets, update the html_css_files (and any html_static_path usage) in
conf.py to reference the local CSS filenames, and ensure the CSS paths inside
those files point to the vendored font files (or update them accordingly) so
offline builds and consistent rendering work.
In `@doc/landing-page/index.rst`:
- Line 397: Replace the hardcoded button-link URL that currently points to
"https://dfetch.rtfd.io/en/latest/migration.html" with the correct path
"https://dfetch.rtfd.io/en/latest/howto/migration.html" so the .. button-link::
directive references the built migration guide under
/en/latest/howto/migration.html; update the string in the .. button-link:: entry
to the new URL.
In `@doc/static/css/custom.css`:
- Around line 374-384: The CSS rule for the selector "table.docutils thead tr
th" (and the matching "table.docutils thead tr th p") uses a quoted font-family
"Inter", which Stylelint flags; update the font-family declaration in that rule
to remove the unnecessary quotes so it reads Inter, sans-serif (keeping the
fallback) to satisfy Stylelint and follow CSS conventions.
- Around line 386-395: In the CSS block for the selector table.docutils tbody tr
td, remove the quotes around the font-family name "Inter" so it reads Inter
(unquoted) to satisfy Stylelint; also update the other occurrence mentioned
(line with font-family further down) to follow the same change while keeping
"Segoe UI" quoted because it contains a space.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1feada70-9da3-4919-b6d2-cddc982e7057
📒 Files selected for processing (20)
doc/_ext/colordot.pydoc/_ext/designguide.pydoc/_templates/about.htmldoc/conf.pydoc/explanation/architecture.rstdoc/explanation/vendoring.rstdoc/howto/check-ci.rstdoc/howto/contributing.rstdoc/howto/migration.rstdoc/howto/patching.rstdoc/howto/sbom.rstdoc/howto/troubleshooting.rstdoc/index.rstdoc/landing-page/index.rstdoc/reference/changelog.rstdoc/reference/glossary.rstdoc/reference/manifest.rstdoc/static/css/custom.cssdoc/tutorials/getting_started.rstpyproject.toml
💤 Files with no reviewable changes (2)
- doc/howto/migration.rst
- doc/explanation/vendoring.rst
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.pre-commit-config.yaml:
- Around line 8-10: The pre-commit exclusion was widened to exclude the entire
^doc/static/ tree, which unintentionally skips project-authored assets; update
the exclude pattern for the end-of-file-fixer hook (id: end-of-file-fixer) to
target only vendored fonts by replacing the exclude value ^doc/static/ with a
narrower pattern such as ^doc/static/fonts/ so CSS/JS/PlantUML files remain
checked while vendored font packages are ignored.
In `@doc/_ext/designguide.py`:
- Around line 55-63: The directive currently accepts any string for the swatch
(variable color) and silently produces invalid output; update the handler that
reads self.arguments[0] (the color variable assigned to color and used to build
color_style) to validate the value and call self.error(...) on invalid input.
Specifically, check that the argument matches an allowed colour token or a hex
color (e.g., regex for ^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$) or is present in your
canonical token set (e.g., COLOR_TOKENS or SUPPORTED_COLORS), and if not, raise
self.error("Invalid swatch value: ...") instead of proceeding; keep using the
same variables (color, color_style) once validated. Ensure the validation
happens before html.escape(...) and before any use of color_style so bad values
fail fast.
In `@doc/conf.py`:
- Around line 132-136: The repository contains an unused Font Awesome CSS file
(regular.css) that is not referenced in the html_css_files list in conf.py
(variable html_css_files) and no `.far`/`.fa-regular` classes are used; delete
the regular.css file from the repository and remove any related unused
references or assets to keep static files in sync with the html_css_files
configuration.
In `@doc/static/css/custom.css`:
- Around line 457-466: Replace the hardcoded color in the nav.sidebar-quicklinks
a rule with the existing CSS token by using var(--text) (keep the !important).
Locate the selector nav.sidebar-quicklinks a and change the color declaration
from `#1c1917` to var(--text) !important so the quicklinks follow the root palette
token.
In `@doc/static/fonts/font-awesome/css/v5-font-face.min.css`:
- Around line 1-6: Delete the dead file
doc/static/fonts/font-awesome/css/v5-font-face.min.css from the repo and remove
any lingering references to it (verify doc/conf.py's html_css_files does not
include "v5-font-face.min.css"); ensure the project continues to use the
existing font files referenced (fontawesome.min.css, solid.min.css,
brands.min.css) and commit the file deletion so the unused asset is removed from
version control.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6b09d5c5-a2b6-48e6-95aa-92abc7e37909
⛔ Files ignored due to path filters (4)
doc/static/fonts/font-awesome/webfonts/fa-brands-400.woff2is excluded by!**/*.woff2doc/static/fonts/font-awesome/webfonts/fa-regular-400.woff2is excluded by!**/*.woff2doc/static/fonts/font-awesome/webfonts/fa-solid-900.woff2is excluded by!**/*.woff2doc/static/fonts/font-awesome/webfonts/fa-v4compatibility.woff2is excluded by!**/*.woff2
📒 Files selected for processing (26)
.pre-commit-config.yamldfetch.yamldoc/_ext/colordot.pydoc/_ext/designguide.pydoc/_templates/about.htmldoc/conf.pydoc/landing-page/index.rstdoc/static/css/custom.cssdoc/static/fonts/font-awesome/.dfetch_data.yamldoc/static/fonts/font-awesome/LICENSE.txtdoc/static/fonts/font-awesome/css/all.cssdoc/static/fonts/font-awesome/css/all.min.cssdoc/static/fonts/font-awesome/css/brands.cssdoc/static/fonts/font-awesome/css/brands.min.cssdoc/static/fonts/font-awesome/css/fontawesome.cssdoc/static/fonts/font-awesome/css/fontawesome.min.cssdoc/static/fonts/font-awesome/css/regular.cssdoc/static/fonts/font-awesome/css/regular.min.cssdoc/static/fonts/font-awesome/css/solid.cssdoc/static/fonts/font-awesome/css/solid.min.cssdoc/static/fonts/font-awesome/css/v4-font-face.cssdoc/static/fonts/font-awesome/css/v4-font-face.min.cssdoc/static/fonts/font-awesome/css/v4-shims.cssdoc/static/fonts/font-awesome/css/v4-shims.min.cssdoc/static/fonts/font-awesome/css/v5-font-face.cssdoc/static/fonts/font-awesome/css/v5-font-face.min.css
| exclude: ^doc/static/ | ||
| - id: end-of-file-fixer | ||
| exclude: ^doc/static/uml/styles/plantuml-c4/ | ||
| exclude: ^doc/static/ |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: List files under doc/static/ to identify vendored vs project-authored content
echo "=== Files under doc/static/ ==="
fd . doc/static/ --type f --max-depth 3
echo ""
echo "=== Checking for project-authored files (CSS, HTML, JS, templates) ==="
fd '\.(css|html|js|jinja|j2)$' doc/static/ --type fRepository: dfetch-org/dfetch
Length of output: 1934
🏁 Script executed:
cat -n .pre-commit-config.yaml | head -30Repository: dfetch-org/dfetch
Length of output: 1066
Exclusion pattern is overly broad and should target only vendored assets.
The change broadens the exclusion from ^doc/static/uml/styles/plantuml-c4/ to the entire ^doc/static/ tree, which excludes project-authored files like doc/static/css/custom.css and doc/static/js/diataxis.js from whitespace and newline checks.
Use a more targeted pattern that excludes only vendored fonts:
exclude: ^doc/static/fonts/This preserves checks on project-authored CSS, JavaScript, and PlantUML diagrams while excluding the vendored font packages (inter, jetbrains-mono, font-awesome).
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 9-9: too many spaces after hyphen
(hyphens)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.pre-commit-config.yaml around lines 8 - 10, The pre-commit exclusion was
widened to exclude the entire ^doc/static/ tree, which unintentionally skips
project-authored assets; update the exclude pattern for the end-of-file-fixer
hook (id: end-of-file-fixer) to target only vendored fonts by replacing the
exclude value ^doc/static/ with a narrower pattern such as ^doc/static/fonts/ so
CSS/JS/PlantUML files remain checked while vendored font packages are ignored.
| color = html.escape(self.arguments[0].strip(), quote=True) | ||
| token = html.escape(self.options.get("token", "")) | ||
| label = html.escape(self.options.get("label", "")) | ||
| usage = html.escape(self.options.get("usage", "")) | ||
| border = html.escape(self.options.get("border", ""), quote=True) | ||
|
|
||
| color_style = f"background:{color};" | ||
| if border: | ||
| color_style += f" border-bottom:1px solid {border};" |
There was a problem hiding this comment.
Validate the swatch argument instead of accepting arbitrary strings.
Lines 55-63 accept any string even though the directive is documented as .. swatch:: #hexcolor``. A typo just renders a blank chip and silently ships bad docs; fail fast with self.error(...) when the value is not a supported colour token.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@doc/_ext/designguide.py` around lines 55 - 63, The directive currently
accepts any string for the swatch (variable color) and silently produces invalid
output; update the handler that reads self.arguments[0] (the color variable
assigned to color and used to build color_style) to validate the value and call
self.error(...) on invalid input. Specifically, check that the argument matches
an allowed colour token or a hex color (e.g., regex for
^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$) or is present in your canonical token set
(e.g., COLOR_TOKENS or SUPPORTED_COLORS), and if not, raise self.error("Invalid
swatch value: ...") instead of proceeding; keep using the same variables (color,
color_style) once validated. Ensure the validation happens before
html.escape(...) and before any use of color_style so bad values fail fast.
| columns: int | None = self.options.get("columns", None) | ||
|
|
||
| style = "" | ||
| if columns: | ||
| style = f' style="grid-template-columns:repeat({columns},1fr);"' | ||
|
|
||
| open_div = nodes.raw("", f'<div class="dg-palette"{style}>\n', format="html") |
There was a problem hiding this comment.
:columns: currently breaks the responsive palette grid.
Line 99 overwrites the repeat(auto-fill, minmax(160px, 1fr)) tracks from doc/static/css/custom.css with fixed repeat({columns}, 1fr). The new :columns: 4 example will therefore squeeze swatches into four tiny columns on narrow screens instead of wrapping.
| html_css_files = [ | ||
| "fonts/font-awesome/css/fontawesome.min.css", | ||
| "fonts/font-awesome/css/solid.min.css", | ||
| "fonts/font-awesome/css/brands.min.css", | ||
| "css/custom.css", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for Font Awesome regular icon usage in documentation
echo "=== Searching for .far or .fa-regular classes in doc files ==="
rg -n '\bfa-regular\b|\bfar\b' doc/ --type=rst --type=html --type=md
echo ""
echo "=== Checking if regular.css should be in html_css_files ==="
cat doc/static/fonts/font-awesome/css/regular.css | head -20Repository: dfetch-org/dfetch
Length of output: 841
Remove the unused doc/static/fonts/font-awesome/css/regular.css file.
The regular Font Awesome CSS file is not loaded in html_css_files and a search for .far or .fa-regular icon classes in the documentation found no usage. The file should be removed from the repository as it serves no purpose.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@doc/conf.py` around lines 132 - 136, The repository contains an unused Font
Awesome CSS file (regular.css) that is not referenced in the html_css_files list
in conf.py (variable html_css_files) and no `.far`/`.fa-regular` classes are
used; delete the regular.css file from the repository and remove any related
unused references or assets to keep static files in sync with the html_css_files
configuration.
| nav.sidebar-quicklinks a { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex: 1; | ||
| padding: 0.3rem 0; | ||
| color: #1c1917 !important; | ||
| text-decoration: none; | ||
| transition: color var(--ease); | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Use the existing text token for the quicklinks.
Line 463 hardcodes #1c1917, but :root already defines the same value as --text. Reusing the token keeps this row aligned with future palette changes.
♻️ Proposed fix
- color: `#1c1917` !important;
+ color: var(--text) !important;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| nav.sidebar-quicklinks a { | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| flex: 1; | |
| padding: 0.3rem 0; | |
| color: #1c1917 !important; | |
| text-decoration: none; | |
| transition: color var(--ease); | |
| } | |
| nav.sidebar-quicklinks a { | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| flex: 1; | |
| padding: 0.3rem 0; | |
| color: var(--text) !important; | |
| text-decoration: none; | |
| transition: color var(--ease); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@doc/static/css/custom.css` around lines 457 - 466, Replace the hardcoded
color in the nav.sidebar-quicklinks a rule with the existing CSS token by using
var(--text) (keep the !important). Locate the selector nav.sidebar-quicklinks a
and change the color declaration from `#1c1917` to var(--text) !important so the
quicklinks follow the root palette token.
| /*! | ||
| * Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com | ||
| * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) | ||
| * Copyright 2026 Fonticons, Inc. | ||
| */ | ||
| @font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(../webfonts/fa-brands-400.woff2) format("woff2")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(../webfonts/fa-solid-900.woff2) format("woff2")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(../webfonts/fa-regular-400.woff2) format("woff2")} No newline at end of file |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Search for references to v5-font-face in the codebase
# Check if v5-font-face is referenced in any config, HTML, or RST files
rg -n -i 'v5-font-face' --type=py --type=html --type=rst
# Check if it's referenced in any other CSS or documentation files
rg -n -i 'v5-font-face' -g '*.css' -g '*.md' -g '*.txt'Repository: dfetch-org/dfetch
Length of output: 43
🏁 Script executed:
# Check if the file exists
ls -lah doc/static/fonts/font-awesome/css/v5-font-face.min.css 2>&1
# Check what's in doc/conf.py for html_css_files
rg -A 10 'html_css_files' doc/conf.py
# Look for any Font Awesome references in the codebase
rg -i 'font.?awesome\|fontawesome' --type=py --type=html --type=rst --type=cssRepository: dfetch-org/dfetch
Length of output: 389
🏁 Script executed:
# Check if any of the loaded CSS files reference v5-font-face
grep -i 'v5-font-face\|@import' doc/static/fonts/font-awesome/css/fontawesome.min.css
grep -i 'v5-font-face\|@import' doc/static/fonts/font-awesome/css/solid.min.css
grep -i 'v5-font-face\|@import' doc/static/fonts/font-awesome/css/brands.min.css
# Also check the custom CSS
grep -i 'v5-font-face' doc/static/css/custom.cssRepository: dfetch-org/dfetch
Length of output: 43
Remove the unused v5-font-face.min.css file.
The file v5-font-face.min.css is not referenced anywhere in the codebase—it's missing from doc/conf.py's html_css_files list and has no imports from other loaded CSS files. The project uses fontawesome.min.css, solid.min.css, and brands.min.css instead. This is dead code that should be removed.
🧰 Tools
🪛 Stylelint (17.5.0)
[error] 6-6: Expected quotes around "url" function argument (function-url-quotes)
(function-url-quotes)
[error] 6-6: Expected quotes around "url" function argument (function-url-quotes)
(function-url-quotes)
[error] 6-6: Expected quotes around "url" function argument (function-url-quotes)
(function-url-quotes)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@doc/static/fonts/font-awesome/css/v5-font-face.min.css` around lines 1 - 6,
Delete the dead file doc/static/fonts/font-awesome/css/v5-font-face.min.css from
the repo and remove any lingering references to it (verify doc/conf.py's
html_css_files does not include "v5-font-face.min.css"); ensure the project
continues to use the existing font files referenced (fontawesome.min.css,
solid.min.css, brands.min.css) and commit the file deletion so the unused asset
is removed from version control.
Summary by CodeRabbit
Documentation
New Features
Bug Fixes