Skip to content

Commit d5979ac

Browse files
authored
Create CONTRIBUTING.md (#20)
1 parent ce5bead commit d5979ac

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing
2+
3+
This project uses [clang format][clang-format] to format code. You can run the formatter
4+
with `make format`.
5+
6+
## Supporting a new `*fetch`
7+
8+
Define a new function in [`src/stats.h`][stats-header] and
9+
[`src/stats.c`][stats-implementation] for your `*fetch` tool. For example, if the tool
10+
was called `examplefetch`, then you would define a new function `examplefetch()`.
11+
12+
Then, update `get_stats()` to use that newly defined function. The stats should be in
13+
case-insensitive alphabetical order.
14+
15+
Finally, update the section "Supported `*fetch` tools" in the [`README.md`][readme] to
16+
list the newly supported tool.
17+
18+
### Updating the example output (optional)
19+
20+
This shouldn't be updated too often, since everyone's environment is different and
21+
constant updates can result in too much file churn. But after a few new `*fetch` tools
22+
get support, it might be a good idea to update the example output in the
23+
[`README.md`][readme]. You can always just copy and paste output from your terminal, but
24+
here are some beginner-friendly examples to copy the output to your clipboard, so you
25+
just have to paste into your text editor.
26+
27+
#### Unix
28+
29+
```shell
30+
fetchfetch | xclip -selection clipboard
31+
```
32+
33+
#### Windows
34+
35+
```batch
36+
rem cmd.exe
37+
fetchfetch.exe | clip.exe
38+
```
39+
40+
```powershell
41+
# PowerShell
42+
fetchfetch.exe | Set-Clipboard
43+
```
44+
45+
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
46+
[readme]: ./README.md
47+
[stats-header]: ./src/stats.h
48+
[stats-implementation]: ./src/stats.c

0 commit comments

Comments
 (0)