fix: frappe semgrep issues flagged by linters#910
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses semgrep/linter findings across the Frappe backend by adding explicit type annotations to various whitelisted API/task functions and suppressing specific semgrep warnings on trusted email/template rendering call sites.
Changes:
- Added/updated function parameter type annotations in multiple API modules.
- Added
# nosemgrepsuppressions (with rationale) onfrappe.render_template/render_templateusages where the template source is considered trusted. - Minor cleanup to avoid an unused variable (
account→_account).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| next_pms/www/next-pms/index.py | Adds semgrep suppression rationale for a dev-only guest-accessible method. |
| next_pms/timesheet/tasks/send_weekly_reminder.py | Suppresses semgrep warnings for rendering Email Template content from DB. |
| next_pms/timesheet/tasks/reminder_on_approval_request.py | Suppresses semgrep warnings for rendering Email Template content from DB with args. |
| next_pms/timesheet/tasks/daily_reminder_for_time_entry.py | Suppresses semgrep warnings for rendering Email Template content from DB with args. |
| next_pms/timesheet/doctype/pms_view_setting/pms_view_setting.py | Adds type annotations to view payload params for create/update whitelisted methods. |
| next_pms/timesheet/api/timesheet.py | Adds type annotations to timesheet API parameters. |
| next_pms/timesheet/api/team.py | Adds type annotations to team compact view params; suppresses template rendering semgrep warnings. |
| next_pms/timesheet/api/task.py | Adds type annotation for projects filter parameter. |
| next_pms/timesheet/api/project_status_update.py | Suppresses semgrep warnings for rendering trusted on-disk HTML templates. |
| next_pms/timesheet/api/project.py | Adds type annotations to project list API parameters. |
| next_pms/timesheet/api/employee.py | Adds type annotations to employee APIs (notably get_employee_from_user). |
| next_pms/resource_management/tasks/no_allocation_reminder.py | Suppresses semgrep warnings for rendering Email Template content from DB. |
| next_pms/resource_management/api/team.py | Adds type annotations to resource management team view API parameters. |
| next_pms/resource_management/api/project.py | Adds type annotations to resource management project view API parameters. |
| next_pms/project_currency/tasks/reminde_project_threshold.py | Suppresses semgrep warnings for rendering Email Template content from DB with args. |
| next_pms/api/init.py | Renames unused variable and adds type annotations to get_doc_with_meta. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 tasks
Aryan20
approved these changes
Apr 6, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
# nosemgrep - trusted Email Template from DBcomments to all email template rendering calls, clarifying that these templates are trusted and suppressing security scan warnings.Relevant Technical Choices
Testing Instructions
Additional Information:
Screenshot/Screencast
Checklist
Fixes #