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
Added more lints #31
Added more lints #31
Conversation
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 think this is fine. Explicitly documenting potential casting problems (overflow when casting to i32) is particularly good.
I think adding Debug impl is also good to have, I think what many of the added ones print is not great but we can improve that later. It's definetly annoying to not have any at all
I am unsure about pedantic. I ran clippy with pedantic a while back and didn't really like the results enough to fully commit to using it. Let's see how it goes
I don't agree with const fn lint on principle, I don't think we should add it
It's beneficial to derive Debug/Copy/Clone and marking functions as "const" when the library is still in an early age. If later on someone needs to use those traits or use some functions in "const" context then that won't result in too many lines of changes. |
I agree that Debug should be there for every public type, but I don't agree about any of the other ones. implementing a trait for a public type or adding |
okay I will remove "clippy::missing_const_for_fn". |
Updated as requested. |
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.
hm those github actions warnings on the State
enum are tricky (see diff view). after all this enum is usually pub(crate)
, but not if used in tests. so you get a warning when compiling without tests feature
can we silence the lint here?
the integration-tests
feature was a mistake :( just don't have better ideas
the last commit is unnecessary. |
btw I don't understand the intention for "integration-tests" feature. even without them the dev-dependency won't be pulled in for library users. |
clippy lints should pass either way
it is a tricky situation that I don't know how to resolve. the html5lib_tokenizer tests need:
unit tests can have private API access, and integration tests can have custom test harness. So my solution was to write integration test, and have a featureflag that, when enabled, exposes private APIs of html5gum publicly |
what do you mean by "custom test harness" |
by defining Since the actual testsuite is a folder of JSON files and each file contains multiple testcases, this allows me to walk that folder, parse the files, and generate testcases. See https://github.com/untitaker/html5gum/blob/main/tests/html5lib_tokenizer.rs -- there's no in case you think that's absolutely insane, in my defense html5ever does the same thing, they don't use libtest-mimic, instead they forked some internal rustc stuff and just... published it on crates.io (see rustc-test crate) |
I actually prefer this... |
It's great if you can add some developer notes in readme explaining the "integration-tests" stuff. |
it's still a custom test harness fwiw, just happens to be a fork of an old version of the standard test harness libtest-mimic seems significantly smaller and attempts to look and feel the same, for the most part |
Yes. If you have more questions/raised eyebrows please just file issues for them, I can probably explain most of it, I hope |
I have no idea why the codecov lint is still failing. I had hoped that my recent commits to master would've fixed that. I'll just merge. Thank you very much! Again I really like the int-casting lint in particular |
The list of new lints are:
clippy::missing_const_for_fn