Reviewable / Reviewable/Reviewable
Feature request: collapse implementations to focus on reviewing interfaces
- Dominant language
- CSS
- Stars
- 209
- Forks
- 39
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 4
Description
Just thinking about [this Twitter thread][1] that was linked to from the Reviewable account, about how reviewing line diffs encourages you to focus on implementation details (usually unimportant but many lines) in your review, rather than APIs (which are more important but fewer lines).
One nice thing about the C/C++ distinction between `.h` and `.c`/`.cc` files was that you could start by reviewing just the header files, then look at the implementation if you didn't see major issues with the API.
One way to recreate this for other languages would be a mode in Reviewable to collapse implementations, e.g. to show this:
```ts
/** Apply a function to each element of an array, returning an array of the results */
function map(arr: In[], func: (v: In) => Out): Out[] { /* ... */ }
```
instead of the full implementation:
```ts
/** Apply a function to each element of an array, returning an array of the results */
function map(arr: In[], func: (v: In) => Out): Out[] {
const out = [];
for (const x of arr) {
out.push(func(x));
}
return out;
}
```
This would obviously require some understanding of what's an interface vs. an implementation in each language.
[1]: https://twitter.com/sheriffnothing/status/1293056562152407040
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.