Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New consecutive_suppression_linter #2306

Merged
merged 17 commits into from
Nov 20, 2023
Merged

Conversation

MichaelChirico
Copy link
Collaborator

Part of #884

No hits on {lintr}

@AshesITR
Copy link
Collaborator

I'm wondering whether this would also fit into library_call_linter(). Alternatively, we could lint successive calls to suppressMessages() regardless of their code content. WDYT?

@MichaelChirico
Copy link
Collaborator Author

I'm wondering whether this would also fit into library_call_linter(). Alternatively, we could lint successive calls to suppressMessages() regardless of their code content. WDYT?

We lost some history here, but my memory is we intentionally left out suppress{Warnings,Messages} because of a prevalence of false positives (where suppressWarnings() twice in a row as done "well"). So the idea of subsuming into library_call_linter() SGTM.

@MichaelChirico
Copy link
Collaborator Author

Marking as draft until #2279 is merged

@MichaelChirico MichaelChirico marked this pull request as ready for review November 19, 2023 01:17
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8414018) 99.39% compared to head (68aaebf) 99.39%.
Report is 1 commits behind head on main.

❗ Current head 68aaebf differs from pull request most recent head e6f282a. Consider uploading reports for the commit e6f282a to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2306   +/-   ##
=======================================
  Coverage   99.39%   99.39%           
=======================================
  Files         120      120           
  Lines        5412     5433   +21     
=======================================
+ Hits         5379     5400   +21     
  Misses         33       33           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AshesITR
Copy link
Collaborator

Metadata tests and intermingled calls would be interesting to check.

@MichaelChirico
Copy link
Collaborator Author

PTAL at the test in 9977822

@AshesITR
Copy link
Collaborator

I was thinking about

suppressMessages()
suppressPackageStartupMessages()
suppressMessages()
suppressPackageStartupMessages()
suppressPackageStartupMessages()

To see how they interact.

@MichaelChirico
Copy link
Collaborator Author

Oh, gotcha. Will add. FWIW, I've never come across this in practice. I assume any author using these consecutive calls is just doing a bunch of copy-paste, rather than thinking carefully about what needs to be suppressed in each case.

@MichaelChirico
Copy link
Collaborator Author

@MichaelChirico MichaelChirico merged commit 9ae6bf2 into main Nov 20, 2023
20 checks passed
@MichaelChirico MichaelChirico deleted the consecutive_suppression branch November 20, 2023 18:57
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.

3 participants