Skip to content

add linting step in dry run#81

Open
tonywu1999 wants to merge 3 commits intodevelfrom
fix-linting
Open

add linting step in dry run#81
tonywu1999 wants to merge 3 commits intodevelfrom
fix-linting

Conversation

@tonywu1999
Copy link
Contributor

@tonywu1999 tonywu1999 commented Mar 5, 2026

Motivation and Context

Please include relevant motivation and context of the problem along with a short summary of the solution.

Changes

Please provide a detailed bullet point list of your changes.

Testing

Please describe any unit tests you added or modified to verify your changes.

Checklist Before Requesting a Review

  • I have read the MSstats contributing guidelines
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • Ran styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4))
  • Ran devtools::document()

Motivation and Context

This PR adds an automated, dry-run code style check to the repository's CI for PRs targeting devel. The goal is to detect deviations from the tidyverse style (with 4-space indentation) early in the review process without modifying files in the workflow run, prompting contributors to run styler locally before merge.

Detailed Changes

  • .github/workflows/dry-run-build.yml

    • Added "Setup R for linting" step using r-lib/actions/setup-r@v2.
    • Added "Check style" step which:
      • Installs styler and roxygen2 via install.packages().
      • Runs .github/scripts/check_style.R to perform a dry-run style check.
    • Inserted these linting steps before the existing "Setup R and Bioconductor" step.
  • .github/scripts/check_style.R

    • New script that calls styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4), dry = "on").
    • If any files would be changed, prints instructions to run styler locally and exits with status 1 to fail the CI job.

Unit Tests

  • No unit tests were added or modified. The change is enforced at CI level (style/dry-run), not via unit tests.

Coding Guidelines

  • No coding guideline violations detected in the added workflow or script.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Warning

Rate limit exceeded

@tonywu1999 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 4 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 857634c3-83ca-4e3a-b24d-33a932674e76

📥 Commits

Reviewing files that changed from the base of the PR and between 7c519ba and 9622117.

📒 Files selected for processing (16)
  • R/annotateProteinInfoFromIndra.R
  • R/cytoscapeNetwork.R
  • R/exportNetworkToHTML.R
  • R/getSubnetworkFromIndra.R
  • R/utils_annotateProteinInfoFromIndra.R
  • R/utils_cytoscapeNetwork.R
  • R/utils_getSubnetworkFromIndra.R
  • tests/testthat/test-annotateProteinInfoFromIndra.R
  • tests/testthat/test-exportNetworkToHTML.R
  • tests/testthat/test-getSubnetworkFromIndra.R
  • tests/testthat/test-utils_annotateProteinInfoFromIndra.R.R
  • tests/testthat/test-utils_cytoscapeNetwork.R
  • tests/testthat/test-utils_getSubnetworkFromIndra.R
  • vignettes/Cytoscape-Visualization.Rmd
  • vignettes/MSstatsBioNet.Rmd
  • vignettes/PTM-Analysis.Rmd
📝 Walkthrough

Walkthrough

Adds a CI linting step that installs R, runs a new check_style.R script which performs a dry-run tidyverse-style check (styler, indent_by = 4) and fails the workflow if style changes are required.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/dry-run-build.yml
Added R setup (r-lib/actions/setup-r@v2) and a step to run the repository's style check script, causing CI failure when style violations are reported.
Style Check Script
.github/scripts/check_style.R
New R script that uses styler (tidyverse, indent_by = 4) to perform a dry-run packaging style check, prints files needing changes, and exits nonzero when changes are detected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibble at whitespace, neat and spry,
I hop through code where stray spaces lie.
Styler whispers, "Tidy the trail,"
CI listens—no messy detail.
A joyful thump: the tests pass by.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template structure with empty sections; the 'Changes' section has an empty bullet point, 'Testing' is blank, and no checklist items are marked as completed. Fill in the 'Changes' section with specific details about the linting setup, describe any testing performed, and mark completed checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'add linting step in dry run' directly describes the main change: adding a linting step to the CI workflow's dry-run build process.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-linting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/scripts/check_style.R (1)

6-10: Consider listing files that need styling.

The current message tells users to run styler::style_pkg() but doesn't indicate which files need changes. Printing the affected file names would help developers identify and fix specific issues faster.

♻️ Proposed improvement to list affected files
 if (any(files$changed)) {
+    changed_files <- files$file[files$changed]
+    message("The following files need styling:")
+    message(paste("  -", changed_files, collapse = "\n"))
+    message("")
     message("The following files need styling. Please run:")
     message("  styler::style_pkg(transformers = styler::tidyverse_style(indent_by = 4))")
     quit(status = 1)
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/scripts/check_style.R around lines 6 - 10, The current block
checking if (any(files$changed)) prints generic guidance but not which files
need styling; update the if block that uses files$changed to also list the
affected file names (e.g., derive the file paths from the same files object and
include them in the message before quitting) so the user can see exactly which
files need styling when the script exits. Ensure you modify the messages in that
conditional (the message(...) calls) to include the affected file list derived
from files$changed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/scripts/check_style.R:
- Around line 6-10: The current block checking if (any(files$changed)) prints
generic guidance but not which files need styling; update the if block that uses
files$changed to also list the affected file names (e.g., derive the file paths
from the same files object and include them in the message before quitting) so
the user can see exactly which files need styling when the script exits. Ensure
you modify the messages in that conditional (the message(...) calls) to include
the affected file list derived from files$changed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee03db10-e027-42ed-8309-048cbc253334

📥 Commits

Reviewing files that changed from the base of the PR and between ad65a68 and 7c519ba.

📒 Files selected for processing (2)
  • .github/scripts/check_style.R
  • .github/workflows/dry-run-build.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/dry-run-build.yml

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 84.77157% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.44%. Comparing base (5b3b03d) to head (9622117).

Files with missing lines Patch % Lines
R/utils_getSubnetworkFromIndra.R 40.35% 34 Missing ⚠️
R/utils_annotateProteinInfoFromIndra.R 85.83% 17 Missing ⚠️
R/utils_cytoscapeNetwork.R 95.68% 5 Missing ⚠️
R/cytoscapeNetwork.R 0.00% 3 Missing ⚠️
R/annotateProteinInfoFromIndra.R 98.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel      #81      +/-   ##
==========================================
+ Coverage   80.09%   80.44%   +0.34%     
==========================================
  Files           7        7              
  Lines         839      900      +61     
==========================================
+ Hits          672      724      +52     
- Misses        167      176       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants