Skip to content

feat(tools): consolidate development tool installations into unified script [skip ci] #7530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 18, 2025

Conversation

rfay
Copy link
Member

@rfay rfay commented Aug 15, 2025

The Issue

DDEV's development, especially for docs, requires specialized tools like pyspelling, textlint, markdownlint, mkdocs, and linkspector. Currently, .envrc installs these per-project, causing overhead and slow startup. Tools are rarely used for link checking locally due to performance issues.

How This PR Solves The Problem

Unified Installation Script

  • Created scripts/install-dev-tools.sh for one-time global installation to ~/.ddev-dev-tools/
  • Supports macOS (brew) and Linux (apt) with automatic platform detection
  • Dynamically fetches mkdocs requirements from repository to stay current
  • Installs all tools: mkdocs, pyspelling, markdownlint, textlint, linkspector, aspell

Optimized .envrc

  • Removed 80+ lines of per-project tool installation code
  • Now simply adds global tools to PATH when available
  • Shows helpful prompts with installation instructions when tools are missing
  • Executes instantly instead of checking/installing tools on every cd

Focused Link Checking

  • Added make linkspector-changed - checks only files modified since main branch
  • Added make linkspector-dir DIR=path/ - checks specific directory
  • Keeps make linkspector for full CI-compatible checking
  • Makes link checking practical for local development workflows

Updated Documentation

  • Updated docs/content/developers/building-contributing.md with unified installation approach
  • Updated docs/content/developers/testing-docs.md with focused linkspector usage
  • Clear distinction between automatic .envrc integration vs global shell profile setup

Implementation Details

Installation Script Features:

  • Cross-platform support (macOS/Linux/WSL2)
  • Virtual environments for Python and Node.js isolation
  • Fetches latest mkdocs requirements from repository
  • Comprehensive verification and helpful error messages

PATH Management:

  • .envrc automatically adds tools when in DDEV directory
  • Optional global access via shell profile modification
  • Graceful fallback with clear installation guidance

Performance Benefits:

  • One-time setup instead of per-project overhead
  • .envrc execution time reduced from seconds to milliseconds
  • Tools remain current via repository-sourced requirements

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

@rfay rfay marked this pull request as ready for review August 15, 2025 02:00
@rfay rfay requested review from a team as code owners August 15, 2025 02:00
@rfay rfay requested a review from stasadev August 15, 2025 02:00
@rfay
Copy link
Member Author

rfay commented Aug 15, 2025

We can try this out if you like it. It works OK for me. I'm glad to have the linkchecker and pyspelling available now for when I need them, was never able to get a reliable install before.

Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

All good, except for the new linkspector commands.

.editorconfig Outdated
Comment on lines 20 to 23
# Script files
[*.sh]
indent_size = 2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommended by:

And ChatGPT recommends 2 spaces.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even realize that .editorconfig was changed here. I prefer 2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to .editorconfig. My IDE uses 2 spaces by default, but declaring a rule for this is better.

rfay and others added 5 commits August 16, 2025 21:12
## The Issue

DDEV's development requires specialized tools like pyspelling, textlint, markdownlint, mkdocs, and linkspector. Currently, .envrc installs these per-project, causing overhead and slow startup. Tools are rarely used for link checking locally due to performance issues.

## How This Commit Solves The Issue

### Unified Installation Script
- Created scripts/install-dev-tools.sh for one-time global installation to ~/.ddev-dev-tools/
- Supports macOS (brew) and Linux (apt) with automatic platform detection
- Dynamically fetches mkdocs requirements from repository to stay current
- Installs all tools: mkdocs, pyspelling, markdownlint, textlint, linkspector, aspell

### Optimized .envrc
- Removed 80+ lines of per-project tool installation code
- Now simply adds global tools to PATH when available
- Shows helpful prompts with installation instructions when tools are missing
- Executes instantly instead of checking/installing tools on every cd

### Focused Link Checking
- Added make linkspector-changed - checks only files modified since main branch
- Added make linkspector-dir DIR=path/ - checks specific directory
- Keeps make linkspector for full CI-compatible checking
- Makes link checking practical for local development workflows

### Updated Documentation
- Updated docs/content/developers/building-contributing.md with unified installation approach
- Updated docs/content/developers/testing-docs.md with focused linkspector usage
- Clear distinction between automatic .envrc integration vs global shell profile setup

## Implementation Details

**Installation Script Features:**
- Cross-platform support (macOS/Linux/WSL2)
- Virtual environments for Python and Node.js isolation
- Fetches latest mkdocs requirements from repository
- Comprehensive verification and helpful error messages

**PATH Management:**
- .envrc automatically adds tools when in DDEV directory
- Optional global access via shell profile modification
- Graceful fallback with clear installation guidance

**Performance Benefits:**
- One-time setup instead of per-project overhead
- .envrc execution time reduced from seconds to milliseconds
- Tools remain current via repository-sourced requirements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…nces

- Added textlint-disable comments around link text that legitimately uses 'Golang'
- This preserves the original link titles while avoiding false positives from terminology rules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…uildkite]

The installation instructions for documentation development tools should only
be in testing-docs.md since that's specifically about working on documentation.
Removed the duplicate section from building-contributing.md to avoid confusion.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…p ci]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rfay rfay force-pushed the 20250814_rfay_tool_installs branch from 36da68c to 26b3b6d Compare August 17, 2025 03:33
@rfay rfay requested a review from stasadev August 17, 2025 03:34
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@rfay rfay merged commit 639d80b into ddev:main Aug 18, 2025
4 checks passed
@rfay rfay deleted the 20250814_rfay_tool_installs branch August 18, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants