diff --git a/.github/workflows/ast-grep-scan.yml b/.github/workflows/ast-grep-scan.yml index 7b1c52383..203fe6e4b 100644 --- a/.github/workflows/ast-grep-scan.yml +++ b/.github/workflows/ast-grep-scan.yml @@ -30,6 +30,4 @@ jobs: uses: actions/checkout@v4 - name: Ast-grep Scan - uses: ast-grep/action@v1.5 - with: - version: 0.21.4 # Version 0.22.0 breaks the missing_punctuation rule. + uses: ast-grep/action@v1.5.0 \ No newline at end of file diff --git a/rules/missing_punctuation.yml b/rules/missing_punctuation.yml index 9cffab06a..4fdcf5111 100644 --- a/rules/missing_punctuation.yml +++ b/rules/missing_punctuation.yml @@ -6,9 +6,10 @@ language: Rust rule: kind: line_comment all: - - regex: '.+[^\\.]$' + - not: + regex: '.\.\s*$' - not: regex: '.*https?://.*' precedes: not: - kind: line_comment \ No newline at end of file + kind: line_comment diff --git a/rules/test_not_named_test.yml b/rules/test_not_named_test.yml index cd74326ac..0d11f3b41 100644 --- a/rules/test_not_named_test.yml +++ b/rules/test_not_named_test.yml @@ -2,7 +2,7 @@ id: test_not_named_test message: Test function not named test_. severity: error language: Rust -# Test functions (annotated with #[test] or #[tokio::test]) must be named test_ etc. +# Test functions (annotated with #[test], #[property_test], and #[tokio::test]) must be named test_ etc. rule: kind: function_item not: @@ -11,4 +11,5 @@ rule: kind: attribute_item any: - pattern: '#[test]' + - pattern: '#[property_test]' - pattern: '#[tokio::test]'