|
1 | | -//! # git-anger-management |
| 1 | +//! # git-anger-library |
2 | 2 | //! [](https://github.com/sondr3/git-anger-management/actions) |
3 | | -//! [](https://crates.io/crates/git-anger-management) |
4 | | -//! [](https://docs.rs/crate/git-anger-management/) |
| 3 | +//! [](https://crates.io/crates/git-anger-library) |
| 4 | +//! [](https://docs.rs/crate/git-anger-library/) |
5 | 5 | //! |
6 | 6 | //! ## What |
7 | 7 | //! |
8 | | -//! Have you ever wondered just how angry your co-workers and/or yourself are? Or |
9 | | -//! just how _naughty_ the commit log for a project is? Worry no more, |
10 | | -//! `git-anger-management` is here to help you. Simply run it against your |
11 | | -//! repository and it'll tell you who is the naughtiest of them all. |
| 8 | +//! This is the main library that drives the |
| 9 | +//! [`git-anger-management`](https://crates.io/crates/git-anger-management) |
| 10 | +//! CLI-application, this is not really useful for anything besides that... but if |
| 11 | +//! you for some reason want to, feel free! |
12 | 12 | //! |
13 | | -//! [](https://asciinema.org/a/329563) |
| 13 | +//! ## Features: |
14 | 14 | //! |
15 | | -//! ## Why |
| 15 | +//! **Note:** None of these features are enabled by default, so you have to opt into |
| 16 | +//! it like so: |
16 | 17 | //! |
17 | | -//! We all have those moments where we finally figured out why something was utterly |
18 | | -//! broken, wrong or both and then had nowhere to scream but to our git commit. I do |
19 | | -//! it all the time, and I wanted to know just how angry I am at my code. |
20 | | -//! |
21 | | -//! # Installation |
22 | | -//! |
23 | | -//! There are two possible ways to install the binary for this: |
24 | | -//! |
25 | | -//! 1. Installation via `cargo`. For this you need to have installed (I recommend |
26 | | -//! installing via [rustup](https://rustup.rs/)), then run `cargo install |
27 | | -//! git-anger-management`. As long as you have `~/.cargo/bin` in your `$PATH` you |
28 | | -//! can now use this program by running it in your terminal. |
29 | | -//! 2. Download the correct binary from the |
30 | | -//! [releases](https://github.com/sondr3/git-anger-management/releases), extract |
31 | | -//! it and copy the file to somewhere on your \$PATH and make it executable: |
32 | | -//! `chmod +x git-anger-management`. |
33 | | -//! |
34 | | -//! ## Usage |
35 | | -//! |
36 | | -//! Simply run the command `git anger-management` and you should get some output |
37 | | -//! that looks something like this: |
38 | | -//! |
39 | | -//! ```sh |
40 | | -//! $ git anger-management |
41 | | -//! Author bitch bloody damn fuck fucking shitty Total |
42 | | -//! ------ ----- ------ ---- ---- ------- ------ ----- |
43 | | -//! John Doe 0 1 1 0 0 0 2 |
44 | | -//! Ola Nordmann 1 0 0 0 1 0 2 |
45 | | -//! Sondre Nilsen 0 0 0 1 1 1 3 |
46 | | -//! ------ ----- ------ ---- ---- ------- ------ ----- |
47 | | -//! Overall 1 1 1 1 2 1 7 |
| 18 | +//! ```toml |
| 19 | +//! [dependencies] |
| 20 | +//! git-anger-library = { version = "0.8.0", features=["table", "json"] } |
48 | 21 | //! ``` |
49 | 22 | //! |
50 | | -//! You can also look in other directories if you want to look somwhere else but |
51 | | -//! you're too lazy to actually `cd` into that directory. Finally, you can also |
52 | | -//! print the output as JSON if you want to further manipulate the data by adding |
53 | | -//! the `-j/--json` flag to the binary: |
54 | | -//! |
55 | | -//! ```sh |
56 | | -//! $ git anger-management --json |
57 | | -//! {"name":"repo","total_commits":5,"total_curses":7,"curses":{"bloody":1,"shitty":1,"fuck":1,"bitch":1,"damn":1,"fucking":2},"authors":{"Sondre Nilsen":{"name":"Sondre Nilsen","total_commits":3,"total_curses":3,"curses":{"shitty":1,"fucking":1,"fuck":1}},"Ola Nordmann":{"name":"Ola Nordmann","total_commits":1,"total_curses":2,"curses":{"bitch":1,"fucking":1}},"John Doe":{"name":"John Doe","total_commits":1,"total_curses":2,"curses":{"damn":1,"bloody":1}}}}⏎ |
58 | | -//! ``` |
| 23 | +//! - `json`: Enables Serde serialization of the processed data using with the |
| 24 | +//! `print_json()` method. |
| 25 | +//! - `table`: Enables pretty printing of the processed data using TabWriter with |
| 26 | +//! the function `print_table()`. |
59 | 27 | //! |
60 | | -//! Finally, you can also look at the help by running `git anger-management -h` for more options. |
61 | | -//! |
62 | | -//! # License |
| 28 | +//! ## License |
63 | 29 | //! |
64 | 30 | //! GPLv3 or later. |
| 31 | +//! |
65 | 32 | /// A git author |
66 | 33 | pub mod author; |
67 | 34 | /// Core algorithms and functionality |
|
0 commit comments