@@ -379,7 +379,8 @@ cases:
379379
380380 - name : qml-fragments
381381 about : doc comments in QML sources lint as QDoc through `[formats]`;
382- the QML code itself is never prose
382+ the QML code itself -- objects, bindings, functions, strings, line
383+ comments, and snippet markers -- is never prose
383384 files :
384385 .vale.ini : |
385386 StylesPath = styles
@@ -390,31 +391,71 @@ cases:
390391
391392 [*.qml]
392393 T.Tok = YES
394+ T.Note = YES
393395 styles/T/Tok.yml : |
394396 extends: existence
395397 message: "'%s' in a doc comment"
396398 level: error
397399 nonword: true
398400 raw:
399401 - ZQX
400- Button.qml : |
402+ styles/T/Note.yml : |
403+ extends: existence
404+ message: "'%s' in a note"
405+ scope: class.note
406+ level: error
407+ nonword: true
408+ tokens:
409+ - ZQX
410+ Slider.qml : |
401411 import QtQuick
402412
403413 /*!
404- \qmltype Button
414+ \qmltype Slider
415+ \inqmlmodule Custom.Controls
405416 \brief A ZQX in the brief.
406417
418+ A ZQX in body prose. Another sentence follows it.
419+
407420 \section1 A ZQX heading
421+
422+ \code
423+ Slider { value: ZQX }
424+ \endcode
425+
426+ \note A ZQX in a note.
408427 */
409- Button {
428+ Item {
429+ id: root
430+
431+ //! [0]
410432 // A ZQX in a line comment stays code.
411- width: ZQX
433+ property real value: 0 // a trailing ZQX comment is code too
434+ //! [0]
435+
436+ /*
437+ A ZQX in a plain block comment still lints.
438+ */
439+ function formatValue(v) {
440+ var label = "a ZQX in a string is code";
441+ return label + v;
442+ }
443+
444+ /*!
445+ \qmlproperty real Slider::value
446+ A second block: its ZQX follows a topic line.
447+ */
412448 }
413- args : Button .qml
449+ args : Slider .qml
414450 exit : 1
415451 want : |
416- Button.qml:5:14:T.Tok:'ZQX' in a doc comment
417- Button.qml:7:17:T.Tok:'ZQX' in a doc comment
452+ Slider.qml:6:14:T.Tok:'ZQX' in a doc comment
453+ Slider.qml:8:7:T.Tok:'ZQX' in a doc comment
454+ Slider.qml:10:17:T.Tok:'ZQX' in a doc comment
455+ Slider.qml:16:13:T.Note:'ZQX' in a note
456+ Slider.qml:16:13:T.Tok:'ZQX' in a doc comment
457+ Slider.qml:27:11:T.Tok:'ZQX' in a doc comment
458+ Slider.qml:36:29:T.Tok:'ZQX' in a doc comment
418459
419460 - name : quarto
420461 about : " #793 -- fenced divs, attributes, and shortcodes are markup, div
@@ -561,6 +602,18 @@ cases:
561602 test.rs:7:4:vale.Annotations:'FIXME' left in text
562603 test.rs:9:5:vale.Annotations:'XXX' left in text
563604
605+ - name : qml
606+ args : test.qml
607+ exit : 0
608+ want : |
609+ test.qml:1:4:vale.Annotations:'NOTE' left in text
610+ test.qml:9:4:vale.Annotations:'XXX' left in text
611+ test.qml:17:8:vale.Annotations:'TODO' left in text
612+ test.qml:23:33:vale.Annotations:'TODO' left in text
613+ test.qml:41:16:vale.Annotations:'XXX' left in text
614+ absent :
615+ - FIXME
616+
564617 - name : r
565618 args : test.r
566619 exit : 0
0 commit comments