Skip to content

Commit a515091

Browse files
authored
Ignore node_modules/site-packages Markdown files (#91)
Before this commit, `check-style.sh` would include all `node_modules` and `site-packages` in its search for Markdown files to checksum. These would get `sha256sum`ed for the `markdown-autodocs` check, which would take time. Ignoring these folders speeds up our precommit a bit.
1 parent 45088e2 commit a515091

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

check-style.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ if [ ! -z "${affected_files}" ]; then
141141
run_check prettier --ignore-unknown --check --loglevel=warn ${affected_files}
142142

143143
# Check documentation snippets (which can be affected by changes in any other file).
144-
markdown_files=$(find . -type f \( -name "*.md" -o -name "*.mdx" \))
144+
# Markdown files exclude `node_modules` (pulled NPM packages) and `site-packages` (pulled Python packages).
145+
markdown_files=$(find . -type f \( -name "*.md" -o -name "*.mdx" \) -not \( -path "*/node_modules/*" -o -path "*/site-packages/*" \))
145146
unindent_auto_doc_script=$(find . -type f -name 'unindent_auto_doc.py')
146147
pre_autodocs_checksum=$(calculate_checksum $markdown_files)
147148
run_check markdown-autodocs -c code-block -o ${markdown_files} > /dev/null && python $unindent_auto_doc_script ${markdown_files} > /dev/null

0 commit comments

Comments
 (0)