mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-05 09:31:05 -05:00
* [AI] Add ast-grep rule to avoid default batch trait methods * reword * fix `FullTextIndexRead::check_match_batch` * move to `tools/ast-grep/` * Add tests * pin ast-grep version * fix spelling
25 lines
741 B
YAML
25 lines
741 B
YAML
id: no-default-batch-methods
|
|
language: rust
|
|
severity: error
|
|
message: Default batch method in trait
|
|
note: |-
|
|
Batch methods on traits must be mandatory so that every implementation makes
|
|
an explicit choice. If the streaming fallback is the right body for some
|
|
implementers, move it into a `default_*` free function next to the trait and
|
|
call it explicitly from each of them.
|
|
rule:
|
|
# Methods with a body are `function_item`s;
|
|
# body-less signatures are `function_signature_item`s.
|
|
kind: function_item
|
|
has:
|
|
field: name
|
|
regex: batch
|
|
inside:
|
|
kind: trait_item
|
|
stopBy: end
|
|
not:
|
|
has:
|
|
field: name
|
|
# The universal_io primitives keep their intentional default bodies.
|
|
regex: Universal
|