Make surface rules token-aware
This commit is contained in:
@@ -140,6 +140,28 @@
|
||||
diags))))
|
||||
(delete-file tmp)))
|
||||
|
||||
(test-group "lint-file-token-aware-no-tabs"
|
||||
(let ((tmp (tmpnam)))
|
||||
(call-with-output-file tmp
|
||||
(lambda (p)
|
||||
(display "#| block\tcomment |#\n" p)))
|
||||
(let ((diags (lint-file tmp '((%pass . surface)))))
|
||||
(test-assert "tab in block comment ignored"
|
||||
(not (any (lambda (d) (eq? (diagnostic-rule d) 'no-tabs))
|
||||
diags))))
|
||||
(delete-file tmp)))
|
||||
|
||||
(test-group "lint-file-token-aware-comment-semantics"
|
||||
(let ((tmp (tmpnam)))
|
||||
(call-with-output-file tmp
|
||||
(lambda (p)
|
||||
(display "(display \"hello\n; not a comment\nworld\")\n" p)))
|
||||
(let ((diags (lint-file tmp '((%pass . surface)))))
|
||||
(test-assert "semicolon inside multiline string ignored"
|
||||
(not (any (lambda (d) (eq? (diagnostic-rule d) 'comment-semicolons))
|
||||
diags))))
|
||||
(delete-file tmp)))
|
||||
|
||||
;;; Fix mode
|
||||
|
||||
(test-group "fix-trailing-whitespace"
|
||||
|
||||
Reference in New Issue
Block a user