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
Check manifest fields for type errors. #485
Conversation
d4b8f23
to
f91eb8f
Compare
f771f34
to
ca78450
Compare
@@ -0,0 +1,111 @@ | |||
# SPDX-License-Identifier: Apache-2.0 |
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.
Nit: Not sure but can we have the name of the file as typechecker
as typechecked
is an internal keyword?
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.
Renamed to match the class name, dataclass_typechecked
.
ref: 1.1 | ||
checks: | ||
- gradle:publish | ||
- gradle:properties:version |
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.
New line here
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.
Added.
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.
Few should have's
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.
This seems like a large/complex amount of work when all the types in the build manifest are strings. Is there a usecase where we need to support numeric values?
Could we do something simpler where we automatically convert all values to strings?
I see the following options.
More importantly, agronholm/typeguard#161 is opened to add the dataclass type checking code to the typeguard library, so the complex code will be then removed from here. There's really not much going on other than that :) |
Signed-off-by: dblock <dblock@dblock.org>
ca78450
to
846470f
Compare
@peternied LMK what you think - this does fix a bug and prevents future bugs. |
Signed-off-by: dblock <dblock@dblock.org>
846470f
to
0972e82
Compare
Codecov Report
@@ Coverage Diff @@
## main #485 +/- ##
==========================================
+ Coverage 69.31% 71.25% +1.93%
==========================================
Files 58 59 +1
Lines 1509 1607 +98
==========================================
+ Hits 1046 1145 +99
+ Misses 463 462 -1
Continue to review full report at Codecov.
|
What about defining a schema document and validating? Implemented something close on my fork Schematize and validate bundle manitests |
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.
Since python doesn't enforce typing I guess I am hesitant to rely on the current effort because while it works right now, a new untyped field could be added and it might be missed.
I like the schema idea better. Do you want to finish that or do you want me to take it? |
@dblock Could you pick it up the schema change and make a new PR? |
Closing in favor of #509. |
Signed-off-by: dblock dblock@dblock.org
Description
ref
values that are floats instead of strings.TestManifest
fromManifest
, enablingfrom_file
andfrom_path
, add tests.Issues Resolved
Closes #470.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.