History

feat: in-manifest and in-lib documentation of feature toggles (#329)

Sebastian Thiel committed 4 years ago

Commit aa3795d1 parent c7dff9e4 files · +26 −28Browse files

Unified · Split

4 files
  1. Cargo.lock +1 −0
  2. cargo-features.md +1 −21
  3. gitoxide-core/Cargo.toml +19 −7
  4. gitoxide-core/src/lib.rs +5 −0
Cargo.lock+1−0
@@ -1759,6 +1759,7 @@ dependencies = [ · 1758 unmodified lines
17591759 "async-trait",
17601760 "blocking",
17611761 "bytesize",
1762+ "document-features",
17621763 "fs-err",
17631764 "futures-io",
17641765 "futures-lite",
cargo-features.md+1−21
@@ -50,27 +50,7 @@ There are **convenience features**, which combine common choices of the above in · 49 unmodified lines
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
gitoxide-core/Cargo.toml+19−7
@@ -13,18 +13,28 @@ test = false · 12 unmodified lines
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 } · 25 unmodified lines
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"]
gitoxide-core/src/lib.rs+5−0
@@ -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))]

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t