Skip to content

Commit

Permalink
fixup! [#139] Ignore build-related files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sereja313 committed Sep 27, 2022
1 parent 2af2796 commit a7141d9
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 11 deletions.
44 changes: 43 additions & 1 deletion tests/golden/check-ignored/check-ignored.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,47 @@ load '../helpers'
@test "Ignore file with broken xrefcheck annotation: directory, check failure" {
to_temp xrefcheck --ignored ./to-ignore/inner-directory/

assert_diff expected.gold
assert_diff - <<EOF
=== Scan errors found ===
➥ In file to-ignore/inner-directory/broken_annotation.md
scan error at src:9:1-30:
⛀ Annotation "ignore file" must be at the top of markdown or right after comments at the top
Scan errors dumped, 1 in total.
EOF
}

@test "Ignore referenced file, check error" {
to_temp xrefcheck --ignored referenced-file.md

assert_diff - <<EOF
=== Scan errors found ===
➥ In file to-ignore/inner-directory/broken_annotation.md
scan error at src:9:1-30:
⛀ Annotation "ignore file" must be at the top of markdown or right after comments at the top
Scan errors dumped, 1 in total.
=== Invalid references found ===
➥ In file check-ignored.md
bad reference (absolute) at src:7:1-37:
- text: "Good reference"
- link: /referenced-file.md
- anchor: -
⛀ File does not exist:
./referenced-file.md
Invalid references dumped, 1 in total.
EOF
}
7 changes: 7 additions & 0 deletions tests/golden/check-ignored/check-ignored.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
- SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io>
-
- SPDX-License-Identifier: MPL-2.0
-->

[Good reference](/referenced-file.md)
10 changes: 0 additions & 10 deletions tests/golden/check-ignored/expected.gold

This file was deleted.

7 changes: 7 additions & 0 deletions tests/golden/check-ignored/referenced-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--
- SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io>
-
- SPDX-License-Identifier: MPL-2.0
-->

referenced file

0 comments on commit a7141d9

Please sign in to comment.