-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: require attr check for nested list and config values. (#672)
* chore: bump kcl version to v0.5.5 * feat: impl list and config schema optional attribute check recursively
- Loading branch information
Showing
6 changed files
with
72 additions
and
1 deletion.
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 +1 @@ | ||
0.5.4 | ||
0.5.5 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
schema S: | ||
a: int | ||
b: str | ||
|
||
schema L: | ||
ss?: [S] | ||
sss?: {str:S} | ||
|
||
L { | ||
ss = [S {b = "b"}] | ||
} |
18 changes: 18 additions & 0 deletions
18
test/grammar/schema/optional_attr/fail_13/stderr.golden.py
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,18 @@ | ||
import sys | ||
import os | ||
|
||
import kclvm.kcl.error as kcl_error | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
kcl_error.print_kcl_error_message( | ||
kcl_error.get_exception(err_type=kcl_error.ErrType.EvaluationError_TYPE, | ||
file_msgs=[ | ||
kcl_error.ErrFileMsg( | ||
filename=os.path.join(cwd, "main.k"), | ||
line_no=10, | ||
), | ||
], | ||
arg_msg="attribute 'a' of S is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |
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 @@ | ||
schema S: | ||
a: int | ||
b: str | ||
|
||
schema L: | ||
ss?: [S] | ||
sss?: {str:S} | ||
|
||
L { | ||
sss.aa: S {b = "2"} | ||
} |
18 changes: 18 additions & 0 deletions
18
test/grammar/schema/optional_attr/fail_14/stderr.golden.py
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,18 @@ | ||
import sys | ||
import os | ||
|
||
import kclvm.kcl.error as kcl_error | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
kcl_error.print_kcl_error_message( | ||
kcl_error.get_exception(err_type=kcl_error.ErrType.EvaluationError_TYPE, | ||
file_msgs=[ | ||
kcl_error.ErrFileMsg( | ||
filename=os.path.join(cwd, "main.k"), | ||
line_no=10, | ||
), | ||
], | ||
arg_msg="attribute 'a' of S is required and can't be None or Undefined") | ||
, file=sys.stdout | ||
) |