buildingSMART / ifc-gherkin-rules

MIT License
9 stars 18 forks source link

IVS-84/Fix - PSE001 stricter prefix matching #264

Open Ghesselink opened 1 month ago

Ghesselink commented 1 month ago

The rule has been made stricter to ensure that incorrect property set names now trigger the rule and produce an error. Previously, this activation was not case-sensitive, leading to false positives with the following examples:

For the property set Pset Wallcommon, the rule still activates and results in an error as intended.

Additionally:

aothms commented 2 weeks ago

Everything is working as anticipated but the Expected message does not provide any clue that the failure is caused by PSET_ at the beginning of the Name attribute instead of Pset. Is there a way to inject that in the Expected field?

Agreed.

These things combined, I could also imagine we write a new scenario specifically around this:

Given its Name attribute starts with "pset" in a case insensitive manner
Then its Name attribute starts with "Pset_" in a case sensitive manner
Ghesselink commented 2 weeks ago

Sounds good, as you suggested before

 Pset_* -> error
[pP][sS][eE][tT]* -> warning

We would be able to make sensitive part for errors and the insensitive for warnings, maybe with the tags.

So for example

@E00020 #Error
Scenario : Case sensitive validation for errors 
Given An IfcPropertySet
Given its Name attribute starts with "pset" in a case insensitive manner
Given its Name attribute starts with "Pset_" in a case sensitive manner
Then The IfcPropertySet Name attribute value must use predefined values according to the "pset_definitions" table #e.g.

@W00030 #Warning
Scenario: Case insensitive validation for warnings
Given an IfcPropertySet
Given its Name attribute starts with "pset" in a case insensitive manner
Given its Name attribute does not start with "Pset_" in a case sensitive manner #don't trigger both error and warning
Then The IfcPropertySet Name attribute value must use predefined values according to the "pset_definitions" table #e.g.

To-do's would then be