id: undesirable_operator-1
language: r
severity: warning
rule:
  any:
    - pattern: $X <<- $Y
    - pattern: $X ->> $Y
message: |
  Avoid undesirable operators `<<-` and `->>`. They assign outside the current
  environment in a way that can be hard to reason about. Prefer fully-encapsulated
  functions wherever possible, or, if necessary, assign to a specific environment
  with assign(). Recall that you can create an environment at the desired scope
  with new.env().

---

id: undesirable_operator-2
language: r
severity: warning
rule:
  kind: namespace_operator
  has:
    pattern: ':::'
message: |
  Operator `:::` is undesirable. It accesses non-exported functions inside
  packages. Code relying on these is likely to break in future versions of the
  package because the functions are not part of the public interface and may be
  changed or removed by the maintainers without notice. Use public functions
  via :: instead.
