-
Notifications
You must be signed in to change notification settings - Fork 6
Description
What
It would be nice to have a --ignore-warnings flag, or even better, something like python's ruff linter config file
Why
My clickworthy-resume dev repo has Test flow that runs using tytanic
[abdullah@abdullahs clickworthy-resume]$ tree -L 3
.
├── LICENSE
├── Makefile
├── README.md
├── src
│ ├── cover-letter.typ
│ ├── lib.typ
│ └── resume-cv.typ
├── template
│ ├── assets
│ │ └── publications.bib
│ ├── cover-letter.typ
│ ├── cv.typ
│ └── resume.typ
├── tests
│ ├── cover-letter
│ │ ├── diff
│ │ ├── out
│ │ ├── ref
│ │ └── test.typ
│ ├── cv
│ │ ├── diff
│ │ ├── out
│ │ ├── ref
│ │ └── test.typ
│ └── resume
│ ├── diff
│ ├── out
│ ├── ref
│ └── test.typ
├── thumbnail.png
└── typst.toml
17 directories, 15 filesIn each test.typ, I am importing my source code using relative paths to make it easier to test without having to install the package locally every time a change is introduced. It makes sense to me for the test to import using relative paths.
Now running typst-package-check check returns a exit code (2) warning not an exit code (1) error (which is nice) but still fails
[abdullah@abdullahs clickworthy-resume]$ typst-package-check check
warning: This import should use the package specification, not a relative path.
┌─ tests/resume/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: This import should use the package specification, not a relative path.
┌─ tests/cv/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: This import should use the package specification, not a relative path.
┌─ tests/cover-letter/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[abdullah@abdullahs clickworthy-resume]$ echo $?
2It would be nice to have --ignore-warnings or such to return exit code 0 for no error results.
Work Around
For now, since warning only outputs result in an exit code 2, i do typst-package-check check || [ $? -eq 2 ] which results in exit code 0
[abdullah@abdullahs clickworthy-resume]$ typst-package-check check || [ $? -eq 2 ]
warning: This import should use the package specification, not a relative path.
┌─ tests/resume/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: This import should use the package specification, not a relative path.
┌─ tests/cv/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: This import should use the package specification, not a relative path.
┌─ tests/cover-letter/test.typ:1:1
│
1 │ #import "../../src/lib.typ": *
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[abdullah@abdullahs clickworthy-resume]$ echo $?
0Discussion/Opinion
Please feel free to share
- if my intuition to import relative paths in
tests/is not the best way. - if there are better ways to go about this whole thing