- Clarify where some examples are, and fix the documentation of these…#1522
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1522 +/- ##
===========================================
Coverage 69.404% 69.405%
- Complexity 8920 8924 +4
===========================================
Files 601 602 +1
Lines 35515 35522 +7
Branches 5904 5907 +3
===========================================
+ Hits 24649 24654 +5
- Misses 8532 8535 +3
+ Partials 2334 2333 -1
|
lbergelson
left a comment
There was a problem hiding this comment.
One comment. Thanks for adding this.
|
|
||
|
|
||
|
|
||
| ### Getting Started |
There was a problem hiding this comment.
This is great. We should have had this forever.
There was a problem hiding this comment.
Can we make these links to the source files?
There was a problem hiding this comment.
We probably want to do a sweep and update the examples to use Path/other new conventions. Pointing them out is a good start though.
| * Provide explanations for the rare cases when functionality is deprecated or removed without replacement. | ||
|
|
||
| We treat any accessible class/method/field as part of our API and attempt to minimize changes to it with the following exceptions: | ||
| * The `htsjdk.samtools.cram` package and subpackages are considered unstable and are undergoing major changes. |
There was a problem hiding this comment.
Ah, yeah. We should probably remove that now.
| * It's also useful for measuring time. | ||
| * An example invocation is: | ||
| * <code>java -cp dist/htsjdk-2.1.1.jar htsjdk.samtools.example.PrintReadsExample in.bam false a.bam</code> | ||
| * <code>java -cp build/lib/htsjdk-< VERSION >.jar htsjdk.samtools.example.PrintReadsExample src/test/resources/htsjdk/samtools/example.bam false /dev/stdout </code> |
There was a problem hiding this comment.
Oh, hey, actually fixing the examples to work is a good idea...
|
back to you @lbergelson |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1522 +/- ##
===========================================
Coverage 69.404% 69.405%
- Complexity 8920 8924 +4
===========================================
Files 601 602 +1
Lines 35515 35522 +7
Branches 5904 5907 +3
===========================================
+ Hits 24649 24654 +5
- Misses 8532 8535 +3
+ Partials 2334 2333 -1
🚀 New features to boost your workflow:
|
… examples to more accurately show where the jar will be after compiling.
de57d11 to
479a356
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughExample resource handling now uses try-with-resources. README guidance and example commands are updated, and ChangesExamples and documentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 132-133: Update the “Getting Started” introduction in README.md
from “Please see example as follows:” to the clearer plural wording “The
following examples show how to get started:”.
In `@src/main/java/htsjdk/samtools/example/PrintReadsExample.java`:
- Line 40: Update the documented JAR classpath from build/lib to build/libs in
the PrintReadsExample command at
src/main/java/htsjdk/samtools/example/PrintReadsExample.java:40 and the
PrintVariantsExample command at
src/main/java/htsjdk/variant/example/PrintVariantsExample.java:47, keeping both
examples consistent with the Gradle output directory.
- Line 40: Update the PrintReadsExample command documentation to use the
portable output filename out.bam instead of /dev/stdout, keeping the example
runnable on Windows and other platforms.
In `@src/main/java/htsjdk/tribble/example/CountRecords.java`:
- Line 131: Update the BED usage text in CountRecords to read “BED (ends in .bed
or .BED)”, removing the duplicated suffix and adding the missing closing
parenthesis to match getFeatureCodec.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8f3a3943-156d-4306-a4b1-f63793b4f76c
📒 Files selected for processing (5)
README.mdsrc/main/java/htsjdk/samtools/example/ExampleSamUsage.javasrc/main/java/htsjdk/samtools/example/PrintReadsExample.javasrc/main/java/htsjdk/tribble/example/CountRecords.javasrc/main/java/htsjdk/variant/example/PrintVariantsExample.java
| * It's also useful for measuring time. | ||
| * An example invocation is: | ||
| * <code>java -cp dist/htsjdk-2.1.1.jar htsjdk.samtools.example.PrintReadsExample in.bam false a.bam</code> | ||
| * <code>java -cp build/lib/htsjdk-< VERSION >.jar htsjdk.samtools.example.PrintReadsExample src/test/resources/htsjdk/samtools/example.bam false /dev/stdout </code> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep both example classpaths consistent with the documented Gradle output.
Both commands use build/lib, while README.md Line [41] documents build/libs; users following either command will not find the generated JAR.
src/main/java/htsjdk/samtools/example/PrintReadsExample.java#L40-L40: changebuild/libtobuild/libs.src/main/java/htsjdk/variant/example/PrintVariantsExample.java#L47-L47: changebuild/libtobuild/libs.
📍 Affects 2 files
src/main/java/htsjdk/samtools/example/PrintReadsExample.java#L40-L40(this comment)src/main/java/htsjdk/variant/example/PrintVariantsExample.java#L47-L47
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/main/java/htsjdk/samtools/example/PrintReadsExample.java` at line 40,
Update the documented JAR classpath from build/lib to build/libs in the
PrintReadsExample command at
src/main/java/htsjdk/samtools/example/PrintReadsExample.java:40 and the
PrintVariantsExample command at
src/main/java/htsjdk/variant/example/PrintVariantsExample.java:47, keeping both
examples consistent with the Gradle output directory.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,120p' src/main/java/htsjdk/samtools/example/PrintReadsExample.javaRepository: samtools/htsjdk
Length of output: 4922
Use a portable output path in the example command. /dev/stdout makes this invocation Unix-only and breaks on Windows; use out.bam or label the example as Unix-specific.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/main/java/htsjdk/samtools/example/PrintReadsExample.java` at line 40,
Update the PrintReadsExample command documentation to use the portable output
filename out.bam instead of /dev/stdout, keeping the example runnable on Windows
and other platforms.
479a356 to
c6c293e
Compare
… examples to more accurately show where the jar will be after compiling.
Summary by CodeRabbit