Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bradjc
Copy link
Contributor

@bradjc bradjc commented Aug 7, 2023

Pull Request Overview

This is part of #3563.

This is an attempt to write down what PR reviewers are/should be looking for when reviewing PRs. Hopefully this helps both reviewers and submitters.

Testing Strategy

n/a

TODO or Help Wanted

Please add commits with additional information.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

alistair23
alistair23 previously approved these changes Aug 9, 2023
jrvanwhy
jrvanwhy previously approved these changes Aug 9, 2023
lschuermann
lschuermann previously approved these changes Aug 9, 2023
Copy link
Member

@lschuermann lschuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, mostly spelling fixes and one comment to make sure that I understand the intended meaning correctly.

Comment on lines +240 to +242
- Are `lib.rs` or `mod.rs` files added? In general these should only be used to
reference other modules and setup exports. Actual OS logic should be in
descriptively named files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that we've been generally following this rule, but Rust's module system sometimes makes it very awkward to require mod.rs at some::path::in::the::module::hierarchy, but then require an extra ::spurious_module_path at the end, just because we add another descriptively named file. In many ways we can work around this through reexports, but we also have counterexamples in the repository.

The current text says "in general these should", and that seems like fine language to me, if it's indeed not actually meant to be a hard rule.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a legacy dating back to the beginnings of tock of using lib.rs in arch crates which I guess is ok, hence my hedging. (Although, actually looking at the commits my excuse isn't really valid, we had a different file and moved it to lib.rs :( 2c1d620)

That being said, for me it is a rule: either you have little code/modularity and do not need a crate/folder, or you have enough code/modularity to warrant a crate/folder and the structure should plan for mode code to be added in the future (i.e. do not use the mod/lib file).

Add fixes and clarifications.

Co-authored-by: Leon Schuermann <[email protected]>
Co-authored-by: Branden Ghena <[email protected]>
@bradjc bradjc dismissed stale reviews from jrvanwhy and alistair23 via 9e67fb0 August 9, 2023 18:39
lschuermann
lschuermann previously approved these changes Aug 9, 2023
Updates from PR.

Co-authored-by: Pat Pannuto <[email protected]>
@ppannuto ppannuto added the last-call Final review period for a pull request. label Aug 21, 2023
@bradjc
Copy link
Contributor Author

bradjc commented Aug 24, 2023

Merge this?

@ppannuto ppannuto added this pull request to the merge queue Aug 29, 2023
Merged via the queue into master with commit 529b026 Aug 29, 2023
@ppannuto ppannuto deleted the code-review-principles branch August 29, 2023 19:58
@bradjc bradjc mentioned this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation last-call Final review period for a pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants