-
-
Notifications
You must be signed in to change notification settings - Fork 16
Port update block #305
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
Port update block #305
Conversation
|
One of the failing tests ( |
I see that it's connected to the change in |
After looking a bit more, I think that it might actually be behaving like it should be. I've pushed a change to the test to accommodate. Let me know if this doesn't look right, @ddaspit. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #305 +/- ##
==========================================
- Coverage 70.53% 70.51% -0.02%
==========================================
Files 386 388 +2
Lines 32311 32362 +51
Branches 4546 4545 -1
==========================================
+ Hits 22791 22821 +30
- Misses 8471 8491 +20
- Partials 1049 1050 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment in UsfmMemoryTextTests.cs.
Reviewed 9 of 11 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @Enkidu93)
src/SIL.Machine/Corpora/ScriptureRefUsfmParserHandlerBase.cs line 266 at r2 (raw file):
} private void StartEmbedTextWrapper(UsfmParserState state, string marker)
C# supports method overloading, so this can be named StartEmbedText, like the other overloaded private methods in this class.
tests/SIL.Machine.Tests/Corpora/UsfmMemoryTextTests.cs line 219 at r3 (raw file):
\c 1 // \p
The test does need to be fixed, but not in the way that you fixed it. The UsfmMemoryText class now correctly returns two rows. The first is an empty paragraph segment for text that can occur before the first verse marker. The second is the verse text.
src/SIL.Machine/Corpora/UsfmUpdateBlockHandler.cs line 3 at r2 (raw file):
namespace SIL.Machine.Corpora { public abstract class UsfmUpdateBlockHandler
This should be an interface.
src/SIL.Machine/Corpora/UsfmUpdateBlock.cs line 8 at r2 (raw file):
public class UsfmUpdateBlock { public List<ScriptureRef> Refs { get; }
These properties can be IReadOnlyLists. You will need to add backing fields for these properties.
src/SIL.Machine/Corpora/UpdateUsfmParserHandler.cs line 408 at r2 (raw file):
( CurrentTextType != ScriptureTextType.None || (state.ParaTag != null && state.ParaTag.Marker == "id")
You can use the ?. operator to simplify this line.
src/SIL.Machine/Corpora/UpdateUsfmParserHandler.cs line 447 at r2 (raw file):
if ( CurrentTextType != ScriptureTextType.None || (state.ParaTag != null && state.ParaTag.Marker == "id")
You can use the ?. operator to simplify this line.
|
Previously, ddaspit (Damien Daspit) wrote…
OK, yeah, I wasn't sure whether I should leave the |
Enkidu93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 11 files reviewed, 6 unresolved discussions (waiting on @ddaspit)
src/SIL.Machine/Corpora/ScriptureRefUsfmParserHandlerBase.cs line 266 at r2 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
C# supports method overloading, so this can be named
StartEmbedText, like the other overloaded private methods in this class.
Done
src/SIL.Machine/Corpora/UpdateUsfmParserHandler.cs line 408 at r2 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
You can use the
?.operator to simplify this line.
Done
src/SIL.Machine/Corpora/UpdateUsfmParserHandler.cs line 447 at r2 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
You can use the
?.operator to simplify this line.
Done
src/SIL.Machine/Corpora/UsfmUpdateBlock.cs line 8 at r2 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
These properties can be
IReadOnlyLists. You will need to add backing fields for these properties.
Done. Do you have a preference for the get => _field or get {return _field; } syntax. I used => since it looked cleaner, but I noticed that both are used frequently throughout the code-base.
src/SIL.Machine/Corpora/UsfmUpdateBlockHandler.cs line 3 at r2 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
This should be an interface.
Done
ddaspit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Enkidu93)
src/SIL.Machine/Corpora/UsfmUpdateBlock.cs line 8 at r2 (raw file):
Previously, Enkidu93 (Eli C. Lowry) wrote…
Done. Do you have a preference for the
get => _fieldorget {return _field; }syntax. I used=>since it looked cleaner, but I noticed that both are used frequently throughout the code-base.
The => syntax is cleaner.
Port of changes here.
Fixes sillsdev/serval#667
This change is