Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions rules/security/whitelisted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ rules:
# Exclude 'self', 'cls', and '*' as they typically don't take hints
regex: ^(?!self$|cls$|\*$).*$
message: "The argument '$ARG' in function '$FUNC' is missing a type hint."
- id: bare-container-type-hint
languages: [python]
severity: WARNING
pattern-either:
- pattern: |
@frappe.whitelist(...)
def $FUNC(..., $ARG: list, ...): ...
- pattern: |
@frappe.whitelist(...)
def $FUNC(..., $ARG: dict, ...): ...
- pattern: |
@frappe.whitelist(...)
def $FUNC(..., $ARG: list | $X, ...): ...
- pattern: |
@frappe.whitelist(...)
def $FUNC(..., $ARG: dict | $X, ...): ...
message: "The argument '$ARG' in function '$FUNC' is missing a specific container type hint (e.g., list[str])."
- id: guest-whitelisted-method
languages: [python]
severity: WARNING
Expand Down