Skip to content

Commit aa3795d

Browse files
committed
feat: in-manifest and in-lib documentation of feature toggles (#329)
1 parent c7dff9e commit aa3795d

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

Diff for: Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: cargo-features.md

+1-21
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,7 @@ There are **convenience features**, which combine common choices of the above in
5050

5151
### gitoxide-core
5252

53-
The library powering the command-line interface.
54-
55-
* **organize**
56-
* **provides the 'organize' command**
57-
* Includes `jwalk` to find repositories quickly in order to move into a directory structure automatically.
58-
* **provides the 'find' command**
59-
* discover all git repositories within a directory. Particularly useful with [skim][skim].
60-
* **estimate-hours**
61-
* Derive the amount of time invested akin to [git-hours].
62-
* _mutually exclusive_
63-
- if both are set, _blocking-client_ will take precedence.
64-
- **blocking-client**
65-
- If set, the client used to connect to git servers will use a blocking API. It supports more transports and is what most would want.
66-
- **async-client**
67-
- The client to connect to git servers will be async, while supporting only the 'git' transport itself. It's the most limited and can be seen as example
68-
on how to use custom transports for custom servers.
69-
* **local-time-support**
70-
- Functions dealing with time may include the local timezone offset, not just UTC with the offset being zero.
71-
72-
[skim]: https://github.com/lotabout/skim
73-
[git-hours]: https://github.com/kimmobrunfeldt/git-hours
53+
Documented in [its documentation](https://docs.rs/gitoxide-core).
7454

7555
### git-pack
7656

Diff for: gitoxide-core/Cargo.toml

+19-7
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,28 @@ test = false
1313

1414
[features]
1515
default = []
16-
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
17-
serde1 = ["git-commitgraph/serde1", "git-repository/serde1", "serde_json", "serde"]
1816

19-
# async or blocking tooling
17+
#! ### Tools
18+
## Discover all git repositories within a directory. Particularly useful with [skim](https://github.com/lotabout/skim).
19+
organize = ["git-url", "jwalk"]
20+
## Derive the amount of time invested into a git repository akin to [git-hours](https://github.com/kimmobrunfeldt/git-hours).
21+
estimate-hours = ["itertools", "rayon", "fs-err"]
22+
23+
#! ### Mutually Exclusive Networking
24+
#! If both are set, _blocking-client_ will take precedence, allowing `--all-features` to be used.
25+
26+
## If set, the client used to connect to git servers will use a blocking API. It supports more transports and is what most would want.
2027
blocking-client = ["git-repository/blocking-network-client"]
28+
## The client to connect to git servers will be async, while supporting only the 'git' transport itself.
29+
## It's the most limited and can be seen as example on how to use custom transports for custom servers.
2130
async-client = ["git-repository/async-network-client", "async-trait", "futures-io", "async-net", "async-io", "futures-lite", "blocking"]
2231

32+
#! ### Other
33+
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
34+
serde1 = ["git-commitgraph/serde1", "git-repository/serde1", "serde_json", "serde"]
35+
## Functions dealing with time may include the local timezone offset, not just UTC with the offset being zero.
2336
local-time-support = ["git-repository/local-time-support"]
2437

25-
# tools
26-
organize = ["git-url", "jwalk"]
27-
estimate-hours = ["itertools", "rayon", "fs-err"]
2838

2939
[dependencies]
3040
# deselect everything else (like "performance") as this should be controllable by the parent application.
@@ -56,5 +66,7 @@ rayon = { version = "1.5.0", optional = true }
5666
itertools = { version = "0.10.1", optional = true }
5767
fs-err = { version = "2.6.0", optional = true }
5868

69+
document-features = { version = "0.1.0", optional = true }
70+
5971
[package.metadata.docs.rs]
60-
features = ["blocking-client", "organize", "estimate-hours", "serde1"]
72+
features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde1"]

Diff for: gitoxide-core/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//! ## Feature Flags
2+
#![cfg_attr(
3+
feature = "document-features",
4+
cfg_attr(doc, doc = ::document_features::document_features!())
5+
)]
16
#![forbid(unsafe_code)]
27
#![deny(rust_2018_idioms)]
38
#![cfg_attr(feature = "async-client", allow(unused))]

0 commit comments

Comments
 (0)