Skip to content

Remove ScrChecks project and replace with streamlined parser#764

Merged
jasonleenaylor merged 3 commits intomainfrom
chore/fixPatch
Mar 16, 2026
Merged

Remove ScrChecks project and replace with streamlined parser#764
jasonleenaylor merged 3 commits intomainfrom
chore/fixPatch

Conversation

@jasonleenaylor
Copy link
Contributor

@jasonleenaylor jasonleenaylor commented Mar 15, 2026

The ScrChecks project under Lib/src was over-engineered for the limited functionality actually used by FieldWorks. Only character sequence parsing (grouping base characters with combining diacritics) was needed.

  • Delete entire Lib/src/ScrChecks/ project and tests
  • Remove unused interfaces: IChecksDataSource, IScriptureCheck, RecordErrorEventArgs
  • Remove ScrChecks from solution, build targets, installer targets
  • Replace with ParseCharacterSequences in TextFileDataSource using StringInfo.GetTextElementEnumerator for correct Unicode handling
  • Update CharContextCtrl and ValidCharactersDlg to remove reflection-based loading of ScrChecks
  • Clean up FwDirectoryFinder ScrChecks directory helper
  • Add comprehensive tests for diacritics, surrogate pairs, supplementary plane chars, and minority language scripts
  • Add Directory.props for Lib to standardize with Src

Co-Authored-By: Claude


This change is Reviewable

The ScrChecks project under Lib/src was over-engineered for the
limited functionality actually used by FieldWorks. Only character
sequence parsing (grouping base characters with combining
diacritics) was needed.

- Delete entire Lib/src/ScrChecks/ project and tests
- Remove unused interfaces: IChecksDataSource, IScriptureCheck,
  RecordErrorEventArgs
- Remove ScrChecks from solution, build targets, installer targets
- Replace with ParseCharacterSequences in TextFileDataSource using
  StringInfo.GetTextElementEnumerator for correct Unicode handling
- Update CharContextCtrl and ValidCharactersDlg to remove
  reflection-based loading of ScrChecks
- Clean up FwDirectoryFinder ScrChecks directory helper
- Add comprehensive tests for diacritics, surrogate pairs,
  supplementary plane chars, and minority language scripts
- Add Directory.props for Lib to standardize with Src

Co-Authored-By: Claude
@github-actions
Copy link

github-actions bot commented Mar 15, 2026

NUnit Tests

    1 files  ±  0      1 suites  ±0   5m 41s ⏱️ -32s
4 058 tests  - 356  3 987 ✅  - 340  71 💤  - 16  0 ❌ ±0 
4 067 runs   - 356  3 996 ✅  - 340  71 💤  - 16  0 ❌ ±0 

Results for commit 40e189d. ± Comparison against base commit dc5f62b.

This pull request removes 382 and adds 26 tests. Note that renamed tests count towards both.
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedHeading
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedList
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedProperName_NotParaStart
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedProperName_ParaStart
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedTableCellHead
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ CapitalizedTitle
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ Footnotes_TreatedSeparately
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ GetLengthOfChar
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ LCaseInRunAfterNote
SILUBS.ScriptureChecks.CapitalizationCheckSilUnitTest ‑ LCaseInRunAfterPicture
…
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ BasicAscii_EachCharSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ CombiningDiacriticFollowsBase_GroupedWithBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_DiacriticBeforeBase_ThenAnotherBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_DiacriticSeparateFromFollowingBase
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ DiacriticsPrecedeBase_MultipleDiacritics_EachSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ Digits_EachSeparate
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ EmptyString_ReturnsEmpty
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_EmptyLines_Skipped
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_ReturnsCorrectOffsetsAndLengths
SIL.FieldWorks.Common.FwUtils.ParseCharacterSequencesTests ‑ GetReferences_SupplementaryCharacters_CorrectOffsets
…

♻️ This comment has been updated with latest results.

}

[Test]
public void GetReferences_EmptyLines_Handled()
Copy link
Contributor

Choose a reason for hiding this comment

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

EmptyLines_Skipped?

public string ScrRefString
{
get { return string.Format(m_scrRefFmtString, m_iLine); }
set { ; }
Copy link
Contributor

Choose a reason for hiding this comment

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

who might try to set this?

/// Not used.
/// </summary>
/// --------------------------------------------------------------------------------
/// <summary>Not used.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're no longer implementing an interface, can we get rid of all these unused properties?

public BCVRef MissingEndRef
{
get { return null; }
set { ; }
Copy link
Contributor

Choose a reason for hiding this comment

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

a couple more empty set blocks may be removable

Copy link
Contributor

@papeh papeh left a comment

Choose a reason for hiding this comment

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

From the installer build log (ValidateStagedAssemblies target):

Stale DLL validation failed - 1 problem(s):
ConvertLib.dll: staged=ConvertLib, Version=1.0.4840.23294, Culture=neutral, PublicKeyToken=null, build=ConvertLib, Version=1.0.9571.28134, Culture=neutral, PublicKeyToken=null (assembly mismatch)
D:\a\FieldWorks\FieldWorks\Build\Installer.legacy.targets(414,3): error MSB3073: The command "powershell -NoProfile -ExecutionPolicy Bypass -File "D:\a\FieldWorks\FieldWorks\Build\Agent\Remove-StaleDlls.ps1" -OutputDir "D:\a\FieldWorks\FieldWorks/BuildDir/FieldWorks_9.3_Build_x64/objects/FieldWorks" -RepoRoot "D:\a\FieldWorks\FieldWorks" -ReferenceDir "D:\a\FieldWorks\FieldWorks\Output\Release" -ValidateOnly" exited with code 1. [D:\a\FieldWorks\FieldWorks\Build\InstallerBuild.proj]

Copy link
Contributor

@papeh papeh left a comment

Choose a reason for hiding this comment

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

* Currently all the artifacts from projects under Lib\src
  are committed in DistFiles - leave that for future evaluation
@jasonleenaylor jasonleenaylor merged commit d58727c into main Mar 16, 2026
8 checks passed
@jasonleenaylor jasonleenaylor deleted the chore/fixPatch branch March 16, 2026 21:20
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