-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1899 from strictdoc-project/stanislaw/auto_uid_wh…
…en_required backend/sdoc: relax the validation of UID when running Manage/AutoUID
- Loading branch information
Showing
14 changed files
with
177 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from strictdoc.core.environment import SDocRuntimeEnvironment | ||
|
||
__version__ = "0.0.57" | ||
__version__ = "0.0.58a1" | ||
|
||
|
||
environment = SDocRuntimeEnvironment(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# Dummy comment to trigger CI. | ||
# Dummy comment to trigger CI |
35 changes: 35 additions & 0 deletions
35
...ommands/manage/auto-uid/requirement_uids/09_edge_grammar_UID_required/input.expected.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: TEXT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
RELATIONS: | ||
- TYPE: Parent | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
STATEMENT: System shall do 1. | ||
|
||
[REQUIREMENT] | ||
UID: REQ-2 | ||
STATEMENT: System shall do 2. | ||
|
||
[REQUIREMENT] | ||
UID: REQ-3 | ||
STATEMENT: System shall do 3. |
34 changes: 34 additions & 0 deletions
34
...gration/commands/manage/auto-uid/requirement_uids/09_edge_grammar_UID_required/input.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: TEXT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
RELATIONS: | ||
- TYPE: Parent | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
STATEMENT: System shall do 1. | ||
|
||
[REQUIREMENT] | ||
UID: REQ-2 | ||
STATEMENT: System shall do 2. | ||
|
||
[REQUIREMENT] | ||
STATEMENT: System shall do 3. |
3 changes: 3 additions & 0 deletions
3
...gration/commands/manage/auto-uid/requirement_uids/09_edge_grammar_UID_required/test.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RUN: cp %S/input.sdoc %S/Output/ | ||
RUN: %strictdoc manage auto-uid %S/Output/ | ||
RUN: %diff %S/input.expected.sdoc %S/Output/input.sdoc |
27 changes: 27 additions & 0 deletions
27
...n/features/document_grammar/validation/03b_valid_field_but_incorrect_order_UID/input.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: TEXT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
RELATIONS: | ||
- TYPE: Parent | ||
|
||
[REQUIREMENT] | ||
STATEMENT: System shall do 1. | ||
UID: REQ-1 |
11 changes: 11 additions & 0 deletions
11
...n/features/document_grammar/validation/03b_valid_field_but_incorrect_order_UID/test.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
RUN: %expect_exit 1 %strictdoc passthrough %S/input.sdoc --output-dir %S/Output/ | filecheck %s | ||
|
||
# The same validation message should be produced even if the auto-uid command is executed. | ||
# https://github.com/strictdoc-project/strictdoc/issues/1896 | ||
RUN: cp %S/input.sdoc %S/Output/ | ||
RUN: %expect_exit 1 %strictdoc manage auto-uid %S/Output/ | ||
|
||
CHECK: error: could not parse file: {{.*}}/input.sdoc. | ||
CHECK: Semantic error: Wrong field order for requirement: [STATEMENT, UID]. | ||
CHECK: Location: {{.*}}/input.sdoc:25:1 | ||
CHECK: Hint: Problematic field: STATEMENT. Compare with the document grammar: [UID, STATEMENT] for type: REQUIREMENT. |
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
...ration/features/document_grammar/validation/04b_missing_required_grammar_field/input.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[DOCUMENT] | ||
TITLE: Hello world doc | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: TEXT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
RELATIONS: | ||
- TYPE: Parent | ||
|
||
[REQUIREMENT] | ||
STATEMENT: System shall do 1. |
6 changes: 6 additions & 0 deletions
6
...ration/features/document_grammar/validation/04b_missing_required_grammar_field/test.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
RUN: %expect_exit 1 %strictdoc passthrough %S/input.sdoc --output-dir %S/Output/ | filecheck %s | ||
|
||
CHECK: error: could not parse file: {{.*}}/input.sdoc. | ||
CHECK: Semantic error: Requirement is missing a field that is required by grammar: UID. | ||
CHECK: Location: {{.*}}/input.sdoc:25:1 | ||
CHECK: Hint: Requirement fields: [STATEMENT], grammar fields: [UID, STATEMENT]. |