-
Notifications
You must be signed in to change notification settings - Fork 6
Add functionality to validate data section only #17
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
862e33e
Add functionality to validate data section only
Ghesselink be15b71
use namespaces instead of kw args
Ghesselink f816e79
remove data_only validation (header is preq for syntax check)
Ghesselink 3552f12
rm only_data
Ghesselink 941e03a
rm simultaneous only-data & only-headercheck
Ghesselink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know... as always the risk with these kind of regexes is that they don't follow the grammar, there can be ENDSEC in a string somewhere or comment. Not likely I know, but still can we do this in another way.
Parsing the header is not time consuming and I guess once we have arrived at this point in the VS we have also established that it's valid, can't we do this in another way, like use the grammar to parse the header (again) to find the exact start offset of the data section. And also don't look for the ENDSEC in the file using the grammar, but just see what the parser tells us that the end of the data section is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm making it too complicated for myself; the idea was that we can still check the header section of a file with an invalid header. However, as you mention, at the moment we check the data section we already established that the header section is valid.
Wouldn't this imply that we can just run
simple_spfas before in this case, i.e. without any data-only section? So:ifcopenshell.simple_spf file.ifc --header-only --jsonifcopenshell.simple_spf file.ifc --jsonSince an error in the header will block the syntax_validation_data task, we'll know for sure that the error is in the data_section if an error occurs there.