Skip to content

Commit f4d81fe

Browse files
committed
Add flowchart for managing pull requests
- Add flowchart for handling ready-to-merge pull requests - Add diagram guidelines Many thanks to Sean Molenaar for the idea and initial version of the chart. CC: Sean Molenaar <[email protected]>
1 parent 39f0784 commit f4d81fe

File tree

5 files changed

+553
-0
lines changed

5 files changed

+553
-0
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ trim_trailing_whitespace = true
1616
# trailing whitespace is crucial for patches
1717
trim_trailing_whitespace = false
1818

19+
[**.drawio.svg]
20+
indent_size = unset
21+
indent_style = unset
22+
insert_final_newline = false
23+
1924
[**.md]
2025
trim_trailing_whitespace = true
2126
x-soft-wrap-text = true

docs/Diagram-Guidelines.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Diagram Guidelines
2+
3+
## Preferred file format
4+
5+
For complex diagrams, use the `.drawio.svg` format.
6+
7+
Files with the `.drawio.svg` extension are SVG files with embedded [draw.io](https://www.diagrams.net/) source code. Using that format lends itself to a developer-friendly workflow: it is valid SVG, plays well with `git diff` and can be edited in lock-step using various online and offline flavours of draw.&#8203;io. If you use VS Code, you can use an [extension](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio) for draw.&#8203;io integration.
8+
9+
Files in the `.drawio.svg` format can be processed offline.
10+
11+
## Embedding a diagram into Markdown
12+
13+
To embed a `.drawio.svg` file into Markdown, use the same syntax as for any image. Example: `![My diagram](my-diagram.drawio.svg)`
14+
15+
Mind that GitHub doesn’t allow styling in Markdown documents. Where styling is allowed (e. g. in the exported brew.sh version of the documentation), always set a background colour of `white` for the diagram. That’s the colour draw.&#8203;io assumes, and keeps the diagram easy to read in dark mode without further customization. You can use the CSS selector `img[src$=".drawio.svg"]` for styling.
16+
17+
## Example
18+
19+
Example for an SVG image embedded into Markdown:
20+
21+
```md
22+
![Example diagram: Managing Pull Requests](assets/img/docs/managing-pull-requests.drawio.svg)
23+
```
24+
25+
Result:
26+
27+
![Example diagram: Managing Pull Requests](assets/img/docs/managing-pull-requests.drawio.svg)
28+
29+
Example for styling (where allowed):
30+
31+
```css
32+
img[src$=".drawio.svg"] {
33+
background-color: white;
34+
margin-bottom: 20px;
35+
padding: 5%;
36+
width: 90%;
37+
}
38+
39+
@media (prefers-color-scheme: dark) {
40+
img[src$=".drawio.svg"] {
41+
filter: invert(85%);
42+
-webkit-filter: invert(85%);
43+
}
44+
}
45+
```

docs/Maintainer-Guidelines.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ their branch is filled with nonsensical merges, then `rebase` and squash
7676
the commits. Our main branch history should be useful to other people,
7777
not confusing.
7878

79+
Here’s a flowchart for managing a PR which is ready to merge:
80+
81+
![Flowchart for managing pull requests](assets/img/docs/managing-pull-requests.drawio.svg)
82+
7983
### Testing
8084

8185
We need to at least check that it builds. Use the [Brew Test Bot](Brew-Test-Bot.md) for this.

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- [Building Against Non-Homebrew Dependencies](Building-Against-Non-Homebrew-Dependencies.md)
4747
- [How To Create (And Maintain) A Tap](How-to-Create-and-Maintain-a-Tap.md)
4848
- [Brew Test Bot](Brew-Test-Bot.md)
49+
- [Diagram Guidelines](Diagram-Guidelines.md)
4950
- [Prose Style Guidelines](Prose-Style-Guidelines.md)
5051
- [Type Checking with Sorbet](Typechecking.md)
5152

0 commit comments

Comments
 (0)