Skip to content

Conversation

@Enkidu93
Copy link
Collaborator

@Enkidu93 Enkidu93 commented Nov 13, 2025

Needed for sillsdev/serval#827


This change is Reviewable

@Enkidu93 Enkidu93 requested a review from ddaspit November 13, 2025 21:26
@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2025

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.47%. Comparing base (c5e7c02) to head (a92ae26).

Files with missing lines Patch % Lines
src/SIL.Machine/Corpora/ScriptureRef.cs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
- Coverage   72.49%   72.47%   -0.03%     
==========================================
  Files         422      422              
  Lines       35791    35803      +12     
  Branches     4949     4949              
==========================================
  Hits        25947    25947              
- Misses       8748     8760      +12     
  Partials     1096     1096              

☔ 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.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

@ddaspit reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93)


src/SIL.Machine/Corpora/ScriptureRef.cs line 53 at r1 (raw file):

                return true;
            }
            catch

Is there a specific exception you can catch? Generally, it is not a good idea to use a bare catch statement, since it can mask unexpected errors.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Enkidu93)


src/SIL.Machine/Corpora/ScriptureRef.cs line 46 at r1 (raw file):

        }

        public static bool TryParse(string str, out ScriptureRef scriptureRef, ScrVers versification = null)

By convention, the out parameter goes at the end. You can use overloading if you need to.

Copy link
Collaborator Author

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ddaspit)


src/SIL.Machine/Corpora/ScriptureRef.cs line 46 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

By convention, the out parameter goes at the end. You can use overloading if you need to.

I was curious about default parameter + out. Yeah, overloading makes sense. Thank you! Done.


src/SIL.Machine/Corpora/ScriptureRef.cs line 53 at r1 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

Is there a specific exception you can catch? Generally, it is not a good idea to use a bare catch statement, since it can mask unexpected errors.

OK, yeah, I wasn't sure if this were an exception since we really don't want TryParse to throw. I added VerseRefException.

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

@ddaspit reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Enkidu93)


src/SIL.Machine/Corpora/ScriptureRef.cs line 46 at r2 (raw file):

        }

        public static bool TryParse(string str, out ScriptureRef scriptureRef)

This method can just call the other method and pass in null for the versification parameter.

Copy link
Collaborator Author

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ddaspit)


src/SIL.Machine/Corpora/ScriptureRef.cs line 46 at r2 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

This method can just call the other method and pass in null for the versification parameter.

Oh yeah, good point - done

Copy link
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

:lgtm:

@ddaspit reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)

@Enkidu93 Enkidu93 merged commit 611b978 into master Nov 13, 2025
4 checks passed
@Enkidu93 Enkidu93 deleted the scripture_ref_try_parse branch November 13, 2025 22:30
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.

4 participants