Skip to content

Commit aad6aac

Browse files
SimplicityGuyclaude
andcommitted
fix: correct mdformat regex to properly exclude virtual environments
The previous regex pattern was not correctly excluding files at the root level of excluded directories like .venv/. The negative lookahead required the pattern to match after a slash, but root-level directories don't have a preceding slash. Changed from: (?!.*/(\.venv|...)) To: (?!.*(^|/)(\.venv|...)) This ensures that files like .venv/lib/python3.13/site-packages/test.md are properly excluded, preventing CI failures when mdformat tries to process third-party library files that don't conform to our formatting standards. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3392845 commit aad6aac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repos:
3535
- mdformat-black==0.1.1
3636
- mdformat-gfm==0.4.1
3737
- mdformat-tables==1.0.0
38-
files: '^(?!.*/(\.venv|venv|__pycache__|\.git|node_modules|\.egg-info|\.pytest_cache|\.mypy_cache|\.ruff_cache|dist|build)/).*\.md$'
38+
files: '^(?!.*(^|/)(\.venv|venv|__pycache__|\.git|node_modules|\.egg-info|\.pytest_cache|\.mypy_cache|\.ruff_cache|dist|build)/).*\.md$'
3939

4040
- repo: https://github.com/astral-sh/ruff-pre-commit
4141
rev: db90487f48a9dd992d243ef63c156eaffddeaf28 # frozen: v0.12.11

0 commit comments

Comments
 (0)