-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path in warnings related to ids of instances is wrong #920
Path in warnings related to ids of instances is wrong #920
Comments
Can you please provide full example of error message? |
Warnings emitted while compiling https://github.com/KOLANICH-specs/kaitai_struct_formats/blob/d3c02f8ed80059f0113c6d6784f087588c921437/hardware/eink_wbf.ksy . Not exposed via JSON when used via CLI, but when used via JPype I have to detect them and distinguishnfrom errors. Since I detect them, I implemented conversion of them into python warnings instead of just ignoring. Since line is not exposed, I have written some code that uses the path to get the line. But the path is invalid. |
If you have a tool that sensitive to paths in errors, you would be interested in kaitai-io/kaitai_struct_compiler#229 which fixes many of them |
Thanks, @Mingun. BTW I have looked into the patch, it seems it doesn't fix this issue. Its source is likely here: https://github.com/kaitai-io/kaitai_struct_compiler/blob/0acfa60452a10b770a2c2e746f3de057f8ab76d9/shared/src/main/scala/io/kaitai/struct/precompile/StyleCheckIds.scala#L48 |
Fixes kaitai-io/kaitai_struct#920 Error count: 62 -> 58 (-4). Fixed: [info] - style_bad_len_inst_pos *** FAILED *** [info] [style_bad_len_inst_pos.ksy: /instances/size_of_foo/id: [info] warning: use `len_foo` instead of `size_of_foo`, given that it's only used as a byte size of `foo` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] [info] did not equal [info] [style_bad_len_inst_pos.ksy: /instances/size_of_foo: [info] warning: use `len_foo` instead of `size_of_foo`, given that it's only used as a byte size of `foo` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] (SimpleMatchers.scala:34) [info] - style_bad_len_inst_value *** FAILED *** [info] [style_bad_len_inst_value.ksy: /instances/size_of_foo/id: [info] warning: use `len_foo` instead of `size_of_foo`, given that it's only used as a byte size of `foo` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] [info] did not equal [info] [style_bad_len_inst_value.ksy: /instances/size_of_foo: [info] warning: use `len_foo` instead of `size_of_foo`, given that it's only used as a byte size of `foo` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] (SimpleMatchers.scala:34) [info] - style_bad_num_inst_pos *** FAILED *** [info] [style_bad_num_inst_pos.ksy: /instances/size_of_foo/id: [info] warning: use `num_foos` instead of `size_of_foo`, given that it's only used as repeat count of `foos` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] [info] did not equal [info] [style_bad_num_inst_pos.ksy: /instances/size_of_foo: [info] warning: use `num_foos` instead of `size_of_foo`, given that it's only used as repeat count of `foos` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] (SimpleMatchers.scala:34) [info] - style_bad_num_inst_value *** FAILED *** [info] [style_bad_num_inst_value.ksy: /instances/size_of_foo/id: [info] warning: use `num_foos` instead of `size_of_foo`, given that it's only used as repeat count of `foos` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] [info] did not equal [info] [style_bad_num_inst_value.ksy: /instances/size_of_foo: [info] warning: use `num_foos` instead of `size_of_foo`, given that it's only used as repeat count of `foos` (see https://doc.kaitai.io/ksy_style_guide.html#attr-id) [info] ] (SimpleMatchers.scala:34)
it says
/id
, but instances have no/id
in YAML DAG, it confuses tools relying on these paths.The text was updated successfully, but these errors were encountered: