-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The linter has a few unit tests, but the [test_cli`(https://github.com/coreruleset/crs-linter/blob/main/tests/test_cli.py) is wrong.
It expects the main() returns with 0, but
- most tests under
examples/contains some error intentionally to demonstrate how the linter works - therefore the
main()mustn't return with0 - the reason is simple: in the unit test we passed wrong path of tests here and here: the
../isn't necessary - the other problem is that if the linter gets a non-existent path for rules, it eats silently, there is no report
I can send a PR, but how do we want to solve this?
My suggestion is:
- add check against
-rargument; if there is a nonexistent file/path, so the files is an empty list, then linter exists immediately - remove
../from arguments'-rof cli's unit test - change
assert == 0toassert == 1
Question: now the APPROVED_TAGS and TEST_EXCLUSIONS are empty (temporary) files; because all listed tests contain some error (intentionally), we don't need to fill them, those need only to start the linter, right?
Metadata
Metadata
Assignees
Labels
No labels