brotherton-erpnext/.github/helper/semgrep_rules/report.yml
Alan 72ece75b11
ci(semgrep): add translation checks for report labels (#27280)
* ci(semgrep): add translation checks for report labels

* refactor: shift report tests to it's own yml

path can't be applied on a test id basis

* ci: ignore regional report in translation checks

[skip ci]
2021-09-01 14:19:39 +05:30

22 lines
630 B
YAML

rules:
- id: frappe-missing-translate-function-in-report-python
paths:
include:
- "**/report"
exclude:
- "**/regional"
pattern-either:
- patterns:
- pattern: |
{..., "label": "...", ...}
- pattern-not: |
{..., "label": _("..."), ...}
- patterns:
- pattern: dict(..., label="...", ...)
- pattern-not: dict(..., label=_("..."), ...)
message: |
All user facing text must be wrapped in translate function. Please refer to translation documentation. https://frappeframework.com/docs/user/en/guides/basics/translations
languages: [python]
severity: ERROR