Collectors Reference
This document provides detailed information about the different types of collectors available in Deply.
BoolCollector
The BoolCollector allows combining other collectors with logical operations.
Configuration Options
type:"bool"must(optional): A list of collectors where all must matchany_of(optional): A list of collectors where at least one must matchmust_not(optional): A list of collectors where none must match
Example
- type: bool
must:
- type: class_name_regex
class_name_regex: ".*Service$"
any_of:
- type: decorator_usage
decorator_name: "transactional"
- type: decorator_usage
decorator_name: "cacheable"
must_not:
- type: file_name_regex
regex: ".*test.*"
ClassInheritsCollector
Collects classes that inherit from a specified base class.
Configuration Options
type:"class_inherits"base_class: The fully qualified name of the base class to matchexclude_files_regex(optional): Regular expression to exclude certain files
Example
- type: class_inherits
base_class: "django.db.models.Model"
exclude_files_regex: ".*test.*"
ClassNameRegexCollector
Collects classes whose names match a specified regular expression.
Configuration Options
type:"class_name_regex"class_name_regex: Regular expression to match class namesexclude_files_regex(optional): Regular expression to exclude certain files
Example
- type: class_name_regex
class_name_regex: ".*Service$"
exclude_files_regex: ".*excluded_folder_name.*"
FunctionNameRegexCollector
Collects functions whose names match a specified regular expression.
Configuration Options
type:"function_name_regex"function_name_regex: Regular expression to match function namesexclude_files_regex(optional): Regular expression to exclude certain files
Example
- type: function_name_regex
function_name_regex: "^helper_.*"
exclude_files_regex: ".*test.*"
Best Practices for Collectors
- Use specific and meaningful regular expressions
- Combine collectors using BoolCollector for complex conditions
- Use exclude_files_regex to filter out test files and other unwanted matches
- Keep collector configurations as simple as possible
- Document complex collector configurations
For more information about using collectors in your configuration, please refer to the Configuration Guide.