-
Notifications
You must be signed in to change notification settings - Fork 88
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
Code Quality CI Checks #44
Comments
You can always |
Yes, I think this should all happen. So for CI I think we can go far by adopting the Druid CI config which is quite battle tested and has the tasks you listed. Of course it will still need some modifications, mostly deletions. Banning Of course I'm also all for enforcing documentation. The private items one is a slight question though, as in does this apply to struct fields? Need to test it I guess, but that might be a bit heavyweight. Public API stuff should definitely all 100% be documented though. |
Yes it does. And enum variants.
I definitely think private items should also be documented for the most part. The way I see it, the purpose of documentation on private items is different the purpose of documentation of public items (it's aimed at developers reading the code not end users), but it's equally valuable. Whether we need to enforce 100% documentation I guess maybe not. I think it's quite useful as a prompt though. Even if you end up writing a pointless comment it means that you've had to go through and at least consider whether a given item needs documentation. Without the lint it's hard to even remember where might need documentation unless you write it as you're going (which often makes no sense to do if the code itself hasn't settled into it's final form yet). |
The one issue with banning unsafe code is the challenges around wgpu Inherently, whichever library integrates a windowing library and wgpu needs to use unsafe for that integration. In the Xilem stack, that library is Xilem. |
Xilem is currently creating a surface with no unsafe. You think this approach isn't sustainable? Even so, special cases can receive a special exemption. So if we need to deal with some unsafe surfaces in Xilem, we can still do that. |
Yes, it's using the unsound |
Are there plans to make that |
I think we can close this now? |
Our lint configuration doesn't yet match the goals here. I would be fine with keeping it open. |
Inspired by this comment, I thought it might be a good idea to add more code quality checks to Xilem's CI. I am thinking we should have:
cargo test
cargo clippy --workspace -- -D warnings
cargo fmt --all -- --check
RUSTDOCFLAGS="-D warnings" cargo doc
Additionally we may want to enforce documentation requirements more strongly. The following
will enforce doc comments on all items. Which seems to me a sensible way to go about things if we want to have an approachable codebase that is welcoming to newcomers.
We might also want to consider:
To completely ban
unsafe
. I'm not sure if that's appropriate for Xilem, but I checked it doesn't currently have anyunsafe
. So perhaps it would be sensible to include that at least until someone makes a case that they needunsafe
?The text was updated successfully, but these errors were encountered: