chore: Update clippy rules and add test cases to increase code coverage#45
Conversation
b5ad59c to
c2722e4
Compare
|
CI for windows is failing due to new tests cases in Will remove the failing test case for now. |
5826ea5 to
c2a23b3
Compare
Code Coverage IncreasesFile-by-File Coverage Improvements
Overall Coverage IncreaseTotal Line Coverage: 81.46% → 94.55% (+13.09%) |
| #[derive(Debug, Error)] | ||
| pub enum GtsError { | ||
| #[error("Invalid GTS segment #{num} @ offset {offset}: '{segment}': {cause}")] | ||
| InvalidSegment { |
There was a problem hiding this comment.
I believe we can't rename enum variants in put GtsError because it would be incompatible change, isn't it?
There was a problem hiding this comment.
This was renamed due to clippy error:
error: all variants have the same prefix: `Invalid`
--> gts/src/gts.rs:31:1
|
31 | / pub enum GtsError {
32 | | #[error("Invalid GTS segment #{num} @ offset {offset}: '{segment}': {cause}")]
33 | | InvalidSegment {
34 | | num: usize,
... |
44 | | InvalidWildcard { pattern: String, cause: String },
45 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#enum_variant_names
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::enum_variant_names)]
There was a problem hiding this comment.
I can revert the changes for this and suppress the error if you want. I think its not really a big deal for this enum since its just 3 variants.
|
|
||
| #[must_use] | ||
| pub fn validate_id(&self, gts_id: &str) -> GtsIdValidationResult { | ||
| pub fn validate_id(gts_id: &str) -> GtsIdValidationResult { |
There was a problem hiding this comment.
This is a breaking change, would you please explain why it was needed?
There was a problem hiding this comment.
There are 2 reasons why this was removed:
validate_idis a stateless function that does not require any instance states- Clippy complained about unused self argument in this function
This is great result! |
c32cca9 to
2e9c484
Compare
2e9c484 to
d83e31d
Compare
Schema_id should not have ":", because this is prohibited symbol in GTS id. Can you please investigate how to fix it? |
I create a new task for this: |
gtslibrarygen_schemas.rscli.rs,logging.rs,server.rsingts-clibinary crategts-macros/src/lib.rs