kdl-rs icon indicating copy to clipboard operation
kdl-rs copied to clipboard

Clippy fixes

Open dmerejkowsky opened this issue 2 years ago • 6 comments

This should make the CI happier

dmerejkowsky avatar Aug 12 '22 13:08 dmerejkowsky

Weird. We no longer have clippy warnings, but tests are failing:

2022-08-12T13:47:35.3175820Z 
2022-08-12T13:47:35.3175976Z failures:
2022-08-12T13:47:35.3176300Z 
2022-08-12T13:47:35.3176997Z ---- document::test::fmt stdout ----
2022-08-12T13:47:35.3177347Z /* x */
2022-08-12T13:47:35.3177622Z foo 1 bar=0xdeadbeef {
2022-08-12T13:47:35.3177899Z     child1 1
2022-08-12T13:47:35.3178185Z     // child 2 comment
2022-08-12T13:47:35.3178476Z     child2 2 // comment
2022-08-12T13:47:35.3178754Z     child3 "\n\n   string\t" {
2022-08-12T13:47:35.3179066Z         /*
2022-08-12T13:47:35.3179259Z 
2022-08-12T13:47:35.3179328Z 
2022-08-12T13:47:35.3179497Z        multiline*/
2022-08-12T13:47:35.3179788Z         inner1 r"value"
2022-08-12T13:47:35.3180048Z         inner2 {
2022-08-12T13:47:35.3180322Z             inner3
2022-08-12T13:47:35.3180584Z                 }
2022-08-12T13:47:35.3180833Z         }
2022-08-12T13:47:35.3181065Z }
2022-08-12T13:47:35.3181645Z // trailing comment herethread 'document::test::fmt' panicked at 'assertion failed: `(left == right)`
2022-08-12T13:47:35.3182378Z   left: `"/* x */\nfoo 1 bar=0xdeadbeef {\n    child1 1\n    // child 2 comment\n    child2 2 // comment\n    child3 \"\\n\\n   string\\t\" {\n        /*\n\n\n       multiline*/\n        inner1 r\"value\"\n        inner2 {\n            inner3\n                }\n        }\n}\n// trailing comment here"`,
2022-08-12T13:47:35.3183538Z  right: `"/* x */\nfoo 1 bar=0xdeadbeef {\n    child1 1\n    // child 2 comment\n    child2 2 // comment\n    child3 \"\\n\\n   string\\t\" {\n        /*\n\n\n       multiline*/\n        inner1 r\"value\"\n        inner2 {\n            inner3\n        }\n    }\n}\n// trailing comment here"`', src/document.rs:460:9

dmerejkowsky avatar Aug 12 '22 13:08 dmerejkowsky

... and I cannot reproduce the tests failures here :(

dmerejkowsky avatar Aug 12 '22 13:08 dmerejkowsky

weird. what??

zkat avatar Aug 12 '22 15:08 zkat

Oh I think this is because of https://github.com/kdl-org/kdl-rs/commit/bbc5e4e6a6ca5f9178a03505f025b5e388e8adcc

I don't know why it didn't fail back then? @cbiffle can you take a look?

zkat avatar Aug 12 '22 16:08 zkat

Well, there was some clippy warnings back when the commit was merged. But since cargo clippy failed, the tests would not run at all.

I think it would be best create a separate workflow for clippy. I can make a PR if you wish.

dmerejkowsky avatar Aug 12 '22 18:08 dmerejkowsky

go for it :)

zkat avatar Aug 12 '22 19:08 zkat