finos / legend-pure

Legend Pure module
https://legend.finos.org
Apache License 2.0
66 stars 136 forks source link

Import group source information validity #844

Closed kevin-m-knight-gs closed 2 months ago

kevin-m-knight-gs commented 2 months ago

Source information with 0 for a line or column value occurs with ImportGroups with no Imports. In the case of an import group for the initial implicit Pure section of a file with no imports, all line and column values will be 0. In the case of an import group for an explicit section with no imports, all column values will be 0 and line values will be the line of the section declaration (e.g., ###Mapping).

To accommodate this, we allow SourceInformation for these two cases to be valid. These can be characterized as cases where all column values are 0 and all line values are equal and non-negative. Otherwise, validity still requires line and column values to be strictly positive.

Additionally, we have updated our compiled state integrity test to ensure that all PackageableElements, including ImportGroups but excluding Packages, have non-null source information. And we have added a test to ensure that all source information is valid.

github-actions[bot] commented 2 months ago

Test Results

   368 files  ±0     368 suites  ±0   1h 18m 5s :stopwatch: + 2m 50s 3 461 tests +7  3 437 :heavy_check_mark: +7  24 :zzz: ±0  0 :x: ±0  4 557 runs  +7  4 533 :heavy_check_mark: +7  24 :zzz: ±0  0 :x: ±0 

Results for commit 80c9fd58. ± Comparison against base commit 3c8a05b9.