Skip to content

Fix lint issues in report.glmmTMB.R by renaming conflicting variable#563

Merged
rempsyc merged 3 commits intomainfrom
copilot/fix-562
Sep 11, 2025
Merged

Fix lint issues in report.glmmTMB.R by renaming conflicting variable#563
rempsyc merged 3 commits intomainfrom
copilot/fix-562

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 11, 2025

This PR fixes object_overwrite_linter warnings in report.glmmTMB.R by renaming the local text variable to random_text to avoid conflicts with the text() function from the graphics package.

Issue:
The report_random.glmmTMB() function was using a local variable named text which conflicts with graphics::text(), causing lint warnings:

# Before - caused object_overwrite_linter warnings
text <- random_terms
text <- paste0("The model included ", text, " as random effect")
text <- ifelse(length(random_terms) > 1, paste0(text, "s"), text)

Solution:
Renamed the variable to random_text for better clarity and to avoid namespace conflicts:

# After - no lint warnings, more descriptive
random_text <- random_terms
random_text <- paste0("The model included ", random_text, " as random effect")
random_text <- ifelse(length(random_terms) > 1, paste0(random_text, "s"), random_text)

This change maintains complete backward compatibility while following the naming patterns used elsewhere in the codebase (e.g., other_text, result_text, parameter_text).

Fixes #562.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
Copilot AI changed the title [WIP] [Copilot]: Fix lint issues in report.glmmTMB.R Fix lint issues in report.glmmTMB.R by renaming conflicting variable Sep 11, 2025
Copilot AI requested a review from rempsyc September 11, 2025 01:03
@rempsyc rempsyc marked this pull request as ready for review September 11, 2025 01:34
@rempsyc rempsyc merged commit 73850ec into main Sep 11, 2025
25 of 26 checks passed
@rempsyc rempsyc deleted the copilot/fix-562 branch September 11, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Copilot]: Fix lint issues in report.glmmTMB.R

2 participants