Add policy section to docs#1127
Conversation
|
Possible other candidate for inclusion, info on SPDX e.g., Files should start with license information as follows: // SPDX-License-Identifier: CC0-1.0 |
|
Neat! A good start. I'm sure others will chime in with things they think we ought to add. We should require three ACKs for this PR. |
apoelstra
left a comment
There was a problem hiding this comment.
ACK a954f0432a1dc63e71d7eb5018da39fb62c5ce9b
Kixunil
left a comment
There was a problem hiding this comment.
Concept ACK, few suggestions.
CONTRIBUTING.md
Outdated
There was a problem hiding this comment.
Error types should be non_exhaustive and have private fields unless you're very confident they won't change.
Error types should not commit to implementing traits they may not be able to implement int the future, especially Copy but possibly also Eq and Ord. They should however commit to Send and Sync.
If the error contains source implement Display using write_err!() macro.
If a function consumes costly-to-compute input (allocations are also considered costly) it should return it back in the error type.
Errors should have Error suffix and conditionally implement std::error::Error if they are public.
There was a problem hiding this comment.
Should we have a small set of derives that are used on all error types? Clone, Debug, PartialEq?
There was a problem hiding this comment.
They should however commit to
SendandSync
I don't know what action is required to achieve this, I imagine other readers of the doc may not either. Can you explain further please?
There was a problem hiding this comment.
Debug is the only one I'd guarantee. Clone is very likely for most error types but there could be exception when we want to return a resource instead of consuming it. (OTOH &mut is probably better)
I don't know what action is required to achieve this
Not putting things like Cell or Rc into Error types. Sadly it could happen by accident without the compiler complaining and we may break the user code. Maybe we should have something like this:
// #[allow(unused)] may be required
trait AssertSendSync: Send + Sync {
}
// Perhaps we could also check other traits
macro_rules! check_pub_error {
($type:ty) => {
impl AssertSendSync for $ty {}
}
}a954f04 to
4535f63
Compare
If/when bors comes about we should consider if there is some way to flag PRs that require more acks. EDIT: I added a label |
|
I'd like some rules that require more acks based on files changed or so, if we have any critical code or policies. Might be reasonably easy to add. |
4535f63 to
2ebecb4
Compare
|
Putting on ice until after release of 0.30.0 |
2ebecb4 to
8578505
Compare
Just flagging that I took this PR off draft but have not actioned this comment of yours @Kixunil, not sure what to do about it? |
|
Our current policy is roughly "if one of the 2 ACKers says that they want a 3rd ACK, then we do it". I wouldn't mind codifying this. But I can't think of a simple mechanical rule that would say "you need 3 ACKs if you touch this file" or something like that. This PR is an example of something that would need 3 ACKs -- though I'm willing to accept @tcharding's PR opening as an implicit ACK, since otherwise it would be hard to get a third. (Unless @sanket1729 wants to chime in on this.) |
8578505 to
4d630e0
Compare
|
changes in force push:
|
sanket1729
left a comment
There was a problem hiding this comment.
ACK 4d630e0ac386eb26a975429af590ea52219362b0
4d630e0 to
271338d
Compare
903b207 to
307ccf1
Compare
119a0ea to
539b8ad
Compare
|
Removed the mention of |
apoelstra
left a comment
There was a problem hiding this comment.
ACK 539b8ad2b9af34ed33113d6738d6e3779dfa7b5a
CONTRIBUTING.md
Outdated
There was a problem hiding this comment.
Dunno what I was doing when I wrote this, the ;s are wrong too. Fixed and force pushed, thanks.
539b8ad to
fe1e8ae
Compare
apoelstra
left a comment
There was a problem hiding this comment.
ACK fe1e8aef8cd24b9695d0effe7fc442a2b8b4ddd0
sanket1729
left a comment
There was a problem hiding this comment.
ACK fe1e8aef8cd24b9695d0effe7fc442a2b8b4ddd0
|
Since @Kixunil is around I'll let him ACK as well before merging. |
|
On ice until next release. |
|
Is it worth adding mention of how silent overflows should be handled (or not handled)? #2086 |
|
I like the idea of having a project-wide overflow policy. But I have no idea what such a policy should be :). Feerates have different rules from amounts, which have different rules from sizes, etc. |
In an effort to consolidate knowledge spread out over time in various places on GitHub add a `Policy` section to `CONTRIBUTING.md`. Add initial sections on import statements, errors, rustdocs,attributes, and licensing.
fe1e8ae to
3bebecc
Compare
|
Can this go in? |
|
cc @sanket1729 @Kixunil we need a second ack here |
In an effort to consolidate knowledge spread out over time in various places on GitHub add a
Policysection toCONTRIBUTING.md.Add initial sections on import statements, errors, rustdocs,attributes, and licensing.