Skip to content

Fix vale lint command to exclude node_modules directory #457

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

Draft
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jun 30, 2025

The invoke lint command was including files from the node_modules directory when the docusaurus package is installed, causing performance issues and thousands of irrelevant linting errors.

Problem

When running invoke lint locally with docusaurus packages installed, the vale linter would process all markdown files in docs/node_modules/, resulting in:

  • 1,795 total files processed (1,761 from node_modules + 34 actual docs)
  • 18,369 errors and 6,952 warnings from third-party package documentation
  • Significantly increased linting time

Solution

Modified the find command in the lint_vale function to exclude the node_modules directory:

# Before
exec_cmd = r'vale $(find ./docs -type f \( -name "*.mdx" -o -name "*.md" \))'

# After  
exec_cmd = r'vale $(find ./docs -type f \( -name "*.mdx" -o -name "*.md" \) -not -path "*/node_modules/*")'

Impact

  • Before: 1,795 files processed
  • After: 34 files processed (only actual documentation files)
  • Eliminates thousands of irrelevant errors from npm package documentation
  • Maintains backward compatibility when node_modules doesn't exist
  • Significantly improves linting performance

Fixes #372.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

cloudflare-workers-and-pages bot commented Jun 30, 2025

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 265c9f0
Status: ✅  Deploy successful!
Preview URL: https://6d1243be.infrahub-sdk-python.pages.dev
Branch Preview URL: https://copilot-fix-372.infrahub-sdk-python.pages.dev

View logs

@Copilot Copilot AI changed the title [WIP] task: Remove node module from vale lint command Fix vale lint command to exclude node_modules directory Jun 30, 2025
@Copilot Copilot AI requested a review from dgarros June 30, 2025 07:31
Copilot finished work on behalf of dgarros June 30, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

task: Remove node module from vale lint command
2 participants