Skip to content

Commit

Permalink
rule: publish realtime w/ room
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Jul 29, 2023
1 parent 283991d commit c751c52
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rules/frappe_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,15 @@ rules:
`debounce` should be used to create a debounced version of function and should only be called once. If the function is called multiple times then each time a new debounced version of function gets created and you don't actually achieve debounce behaviour.
languages: [javascript]
severity: ERROR

- id: frappe-realtime-pick-room
patterns:
- pattern: frappe.publish_realtime(...)
- pattern-not: frappe.publish_realtime(..., doctype=$SOMETHING, ...)
- pattern-not: frappe.publish_realtime(..., docname=$SOMETHING, ...)
- pattern-not: frappe.publish_realtime(..., room=$SOMETHING, ...)
- pattern-not: frappe.publish_realtime(..., user=$SOMETHING, ...)
message: |
This call will publish message to everyone on site, do you really want that? Specify doctype, docname, room or user.
languages: [python]
severity: ERROR

0 comments on commit c751c52

Please sign in to comment.