-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: At the moment, we're using the ignored option for mainly 2 purposes: 1) to ignore all files in the `.git` folder (`.git/**/*`) to ignore all build-related temporary files (the default config ignores `.stack-work/**/*`). A more robust alternative might be to ignore all files implicitly ignored by git. Solution: Use `git ls-files` to ignore all files implicitly ignored by git.
- Loading branch information
Showing
22 changed files
with
281 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bats | ||
|
||
# SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
load '../helpers/bats-support/load' | ||
load '../helpers/bats-assert/load' | ||
load '../helpers/bats-file/load' | ||
load '../helpers' | ||
|
||
@test "Git: not a repo" { | ||
cd $TEST_TEMP_DIR | ||
|
||
run xrefcheck | ||
|
||
assert_output --partial "fatal: not a git repository" | ||
} | ||
|
||
@test "Git: file not tracked" { | ||
cd $TEST_TEMP_DIR | ||
|
||
git init | ||
|
||
echo "[a](/a.md)" >> "git.md" | ||
|
||
run xrefcheck | ||
|
||
assert_output --partial "All repository links are valid." | ||
} | ||
|
||
@test "Git: file tracked, check failure" { | ||
cd $TEST_TEMP_DIR | ||
|
||
git init | ||
|
||
echo "[a](./a.md)" >> "git.md" | ||
|
||
git add git.md | ||
|
||
to_temp xrefcheck | ||
|
||
assert_diff - <<EOF | ||
=== Invalid references found === | ||
➥ In file git.md | ||
bad reference (relative) at src:1:1-11: | ||
- text: "a" | ||
- link: ./a.md | ||
- anchor: - | ||
⛀ File does not exist: | ||
a.md | ||
Invalid references dumped, 1 in total. | ||
EOF | ||
} |
Oops, something went wrong.