Skip to content

Commit af62d03

Browse files
authored
Run MD tests for Markdown-only changes (#19479)
## Summary Exclusions in Git pathspecs [are not order-sensitive](https://css-tricks.com/git-pathspecs-and-how-to-use-them/#aa-exclude): > After all other pathspecs have been resolved, all pathspecs with an exclude signature are resolved and then removed from the returned paths. This means that we can't write chains like we had here before to exclude Markdown file changes *unless* they are in `crates/ty_python_semantic/resources/mdtest`. This doesn't work. The exclude pattern will just overwrite the second pattern and all Markdown changes will be excluded: ```bash ':!**/*.md' \ ':crates/ty_python_semantic/resources/mdtest/**/*.md' \ ``` The configuration we had here before meant that tests wouldn't run on MD-test only PRs, see e.g. #19476. So here, I'm proposing to remove the broad `:!**/*.md` pattern. We can always add more fine-grained exclusion patterns, if that's needed. The `docs` folder is already excluded. ## Test Plan Tested with local `git diff` invocations.
1 parent 30683e3 commit af62d03

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ jobs:
143143
env:
144144
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
145145
run: |
146-
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':**' \
147-
':!**/*.md' \
148-
':crates/ty_python_semantic/resources/mdtest/**/*.md' \
146+
# NOTE: Do not exclude all Markdown files here, but rather use
147+
# specific exclude patterns like 'docs/**'), because tests for
148+
# 'ty' are written in Markdown.
149+
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
149150
':!docs/**' \
150151
':!assets/**' \
151-
':.github/workflows/ci.yaml' \
152152
; then
153153
echo "changed=false" >> "$GITHUB_OUTPUT"
154154
else

0 commit comments

Comments
 (0)