Skip to content

Commit 73a9fce

Browse files
Merge pull request #33 from sebastienrousseau/feat/march
feat(libmake): ✨ v0.2.2
2 parents 16cd253 + 3db7219 commit 73a9fce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2956
-806
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.DS_Store
22
*.profraw
3-
ssg.log
3+
*.log
44
/.vscode/
55
/target/
66
build

Cargo.toml

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ name = "libmake"
2222
readme = "README.md"
2323
repository = "https://github.com/sebastienrousseau/libmake.git"
2424
rust-version = "1.75.0"
25-
version = "0.2.1"
25+
version = "0.2.2"
2626
include = [
2727
"/CONTRIBUTING.md",
2828
"/LICENSE-APACHE",
@@ -52,27 +52,32 @@ path = "benches/criterion.rs"
5252
debug = true
5353

5454
[dependencies]
55-
anyhow = "1.0.77"
56-
assert_cmd = "2.0.12"
57-
clap = "4.4.12"
55+
anyhow = "1.0.81"
56+
assert_cmd = "2.0.14"
57+
clap = "4.5.3"
5858
csv = "1.3.0"
5959
dtt = "0.0.5"
60-
env_logger = "0.10.1"
60+
env_logger = "0.11.3"
6161
figlet-rs = "0.1.5"
62-
openssl = { version = "0.10.62", features = ["vendored"] }
63-
reqwest = { version = "0.11.23", features = ["blocking"] }
64-
rlg = "0.0.2"
65-
serde = { version = "1.0.193", features = ["derive"] }
66-
serde_json = "1.0.108"
67-
serde_yaml = "0.9.29"
68-
tempfile = "3.9.0"
69-
toml = "0.8.8"
70-
vrd = "0.0.5"
62+
configparser = "3.0.4"
63+
reqwest = { version = "0.12.1", features = ["blocking"] }
64+
rlg = "0.0.3"
65+
serde = { version = "1.0.197", features = ["derive"] }
66+
serde_json = "1.0.114"
67+
serde_yaml = "0.9.33"
68+
tempfile = "3.10.1"
69+
toml = "0.8.12"
70+
uuid = { version = "1.8.0", features = ["v4"] }
71+
vrd = "0.0.6"
7172
xtasks = "0.0.2"
7273

74+
# Unix platforms use OpenSSL for now to provide SSL functionality
75+
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
76+
openssl = { version = "0.10.64", features = ["vendored"] }
77+
7378
[dev-dependencies]
7479
criterion = "0.5.1"
75-
predicates = "3.0.4"
80+
predicates = "3.1.0"
7681

7782
[lib]
7883
crate-type = ["lib"]
@@ -83,6 +88,42 @@ required-features = []
8388
[features]
8489
default = []
8590

91+
# Linting config
92+
[lints.rust]
93+
94+
## Forbid
95+
missing_debug_implementations = "forbid"
96+
missing_docs = "warn"
97+
non_ascii_idents = "forbid"
98+
unreachable_pub = "forbid"
99+
unsafe_code = "forbid"
100+
101+
## Deny
102+
dead_code = "deny"
103+
deprecated_in_future = "deny"
104+
ellipsis_inclusive_range_patterns = "deny"
105+
explicit_outlives_requirements = "deny"
106+
future_incompatible = "deny"
107+
keyword_idents = "deny"
108+
macro_use_extern_crate = "deny"
109+
meta_variable_misuse = "deny"
110+
missing_fragment_specifier = "deny"
111+
noop_method_call = "deny"
112+
pointer_structural_match = "deny"
113+
rust_2018_idioms = "deny"
114+
rust_2021_compatibility = "deny"
115+
single_use_lifetimes = "deny"
116+
trivial_casts = "deny"
117+
trivial_numeric_casts = "deny"
118+
unused = "deny"
119+
unused_features = "deny"
120+
unused_import_braces = "deny"
121+
unused_labels = "deny"
122+
unused_lifetimes = "deny"
123+
unused_macro_rules = "deny"
124+
unused_qualifications = "deny"
125+
variant_size_differences = "deny"
126+
86127
[profile.dev]
87128
codegen-units = 256
88129
debug = true

README.md

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ The library is designed to be used as a command-line tool. It is available on [C
5151
- [Documentation](#documentation)
5252
- [Usage](#usage)
5353
- [Command-line interface](#command-line-interface)
54-
- [Generate a new library using a CSV file](#generate-a-new-library-using-a-csv-file)
55-
- [Generate a new library using a JSON file](#generate-a-new-library-using-a-json-file)
56-
- [Generate a new library using a TOML file](#generate-a-new-library-using-a-toml-file)
57-
- [Generate a new library using a YAML file](#generate-a-new-library-using-a-yaml-file)
54+
- [Passing a configuration file](#passing-a-configuration-file)
55+
- [Generate a new library using a CSV file](#generate-a-new-library-using-a-csv-file)
56+
- [Generate a new library using an INI file](#generate-a-new-library-using-an-ini-file)
57+
- [Generate a new library using a JSON file](#generate-a-new-library-using-a-json-file)
58+
- [Generate a new library using a TOML file](#generate-a-new-library-using-a-toml-file)
59+
- [Generate a new library using a YAML file](#generate-a-new-library-using-a-yaml-file)
5860
- [Generate a new library using the command-line interface (CLI) directly](#generate-a-new-library-using-the-command-line-interface-cli-directly)
5961
- [Examples](#examples)
6062
- [Semantic Versioning Policy](#semantic-versioning-policy)
@@ -99,7 +101,7 @@ libmake --help
99101

100102
### Requirements
101103

102-
The minimum supported Rust toolchain version is currently Rust `1.71.1` or later (stable).
104+
The minimum supported Rust toolchain version is currently Rust `1.75.0` or later (stable).
103105

104106
`LibMake` is supported and has been tested on the following platforms:
105107

@@ -149,72 +151,91 @@ support additional platforms, please submit a pull request.
149151

150152
`LibMake` provides a command-line interface to generate a new library project. There are a few options available to help you get started.
151153

152-
#### Generate a new library using a CSV file
154+
#### Passing a configuration file
155+
156+
##### Generate a new library using a CSV file
153157

154158
The following command generates a library template from a CSV file.
155159

156160
Have a look at the `tests/data/mylibrary.csv` file for an example and
157161
feel free to use it for your own library as a template.
158162

159163
```shell
160-
libmake --csv tests/data/mylibrary.csv
164+
libmake file --csv tests/data/mylibrary.csv
165+
```
166+
167+
or locally if you have cloned the repository:
168+
169+
```shell
170+
cargo run -- file --csv tests/data/mylibrary.csv
171+
```
172+
173+
##### Generate a new library using an INI file
174+
175+
The following command generates a library template from an INI file.
176+
177+
Have a look at the `tests/data/mylibrary.ini` file for an example and
178+
feel free to use it for your own library as a template.
179+
180+
```shell
181+
libmake file --ini tests/data/mylibrary.ini
161182
```
162183

163184
or locally if you have cloned the repository:
164185

165186
```shell
166-
cargo run -- --csv tests/data/mylibrary.csv
187+
cargo run -- file --ini tests/data/mylibrary.ini
167188
```
168189

169-
#### Generate a new library using a JSON file
190+
##### Generate a new library using a JSON file
170191

171192
The following command generates a library template from a JSON file.
172193

173194
Have a look at the `tests/data/mylibrary.json` file for an example and
174195
feel free to use it for your own library as a template.
175196

176197
```shell
177-
libmake --json tests/data/mylibrary.json
198+
libmake file --json tests/data/mylibrary.json
178199
```
179200

180201
or locally if you have cloned the repository:
181202

182203
```shell
183-
cargo run -- --json tests/data/mylibrary.json
204+
cargo run -- file --json tests/data/mylibrary.json
184205
```
185206

186-
#### Generate a new library using a TOML file
207+
##### Generate a new library using a TOML file
187208

188209
The following command generates a library template from a TOML file.
189210

190211
Have a look at the `tests/data/mylibrary.toml` file for an example and
191212
feel free to use it for your own library as a template.
192213

193214
```shell
194-
libmake --toml tests/data/mylibrary.toml
215+
libmake file --toml tests/data/mylibrary.toml
195216
```
196217

197218
or locally if you have cloned the repository:
198219

199220
```shell
200-
cargo run -- --toml tests/data/mylibrary.toml
221+
cargo run -- file --toml tests/data/mylibrary.toml
201222
```
202223

203-
#### Generate a new library using a YAML file
224+
##### Generate a new library using a YAML file
204225

205226
The following command generates a library template from a YAML file.
206227

207228
Have a look at the `tests/data/mylibrary.yaml` file for an example and
208229
feel free to use it for your own library as a template.
209230

210231
```shell
211-
libmake --yml tests/data/mylibrary.yaml
232+
libmake file --yaml tests/data/mylibrary.yaml
212233
```
213234

214235
or locally if you have cloned the repository:
215236

216237
```shell
217-
cargo run -- --yml tests/data/mylibrary.yaml
238+
cargo run -- file --yaml tests/data/mylibrary.yaml
218239
```
219240

220241
#### Generate a new library using the command-line interface (CLI) directly
@@ -223,7 +244,7 @@ The following command generates a library template using the command-line
223244
interface.
224245

225246
```shell
226-
libmake \
247+
libmake manual\
227248
--author "John Smith" \
228249
--build "build.rs" \
229250
--categories "['category 1', 'category 2', 'category 3']" \
@@ -238,15 +259,15 @@ libmake \
238259
--output "my_library" \
239260
--readme "README.md" \
240261
--repository "https://github.com/example/my_library" \
241-
--rustversion "1.71.1" \
262+
--rustversion "1.75.0" \
242263
--version "0.1.0" \
243264
--website "https://example.com/john-smith"
244265
```
245266

246267
or locally if you have cloned the repository:
247268

248269
```shell
249-
cargo run -- --author "John Smith" \
270+
cargo run -- manual --author "John Smith" \
250271
--build "build.rs" \
251272
--categories "['category 1', 'category 2', 'category 3']" \
252273
--description "A Rust library for doing cool things" \
@@ -260,7 +281,7 @@ cargo run -- --author "John Smith" \
260281
--output "my_library" \
261282
--readme "README.md" \
262283
--repository "https://github.com/example/my_library" \
263-
--rustversion "1.71.1" \
284+
--rustversion "1.75.0" \
264285
--version "0.1.0" \
265286
--website "https://example.com/john-smith"
266287
```
@@ -276,6 +297,7 @@ To run the examples, clone the repository and run the following command in your
276297
| `generate_from_args` | Generates a library template using the command-line interface. | `cargo run --example generate_from_args` |
277298
| `generate_from_config` | Generates a library template from a configuration file. | `cargo run --example generate_from_config` |
278299
| `generate_from_csv` | Generates a library template from a CSV file. | `cargo run --example generate_from_csv` |
300+
| `generate_from_ini` | Generates a library template from an INI file. | `cargo run --example generate_from_ini` |
279301
| `generate_from_json` | Generates a library template from a JSON file. | `cargo run --example generate_from_json` |
280302
| `generate_from_toml` | Generates a library template from a TOML file. | `cargo run --example generate_from_toml` |
281303
| `generate_from_yaml` | Generates a library template from a YAML file. | `cargo run --example generate_from_yaml` |
@@ -334,6 +356,6 @@ providing a lot of useful suggestions on how to improve this project.
334356
[crates-badge]: https://img.shields.io/crates/v/libmake.svg?style=for-the-badge "Crates.io Badge"
335357
[divider]: https://kura.pro/common/images/elements/divider.svg "divider"
336358
[docs-badge]: https://img.shields.io/docsrs/libmake.svg?style=for-the-badge "Docs.rs Badge"
337-
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.1-orange.svg?style=for-the-badge "Lib.rs Badge"
359+
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.2-orange.svg?style=for-the-badge "Lib.rs Badge"
338360
[license-badge]: https://img.shields.io/crates/l/libmake.svg?style=for-the-badge "License Badge"
339361
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust "Made With Rust Badge"

TEMPLATE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
alt="LibMake logo" width="261" align="right" />
55

66
<!-- markdownlint-enable MD033 MD041 -->
7-
# LibMake v0.2.1 🦀
7+
8+
# LibMake v0.2.2 🦀
89

910
A code generator to reduce repetitive tasks and build high-quality Rust libraries.
1011

@@ -63,6 +64,6 @@ The library is designed to be used as a command-line tool. It is available on [C
6364
[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/libmake?style=for-the-badge&token=Q9KJ6XXL67 "Codecov Badge"
6465
[crates-badge]: https://img.shields.io/crates/v/libmake.svg?style=for-the-badge "Crates.io Badge"
6566
[docs-badge]: https://img.shields.io/docsrs/libmake.svg?style=for-the-badge "Docs.rs Badge"
66-
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.1-orange.svg?style=for-the-badge "Lib.rs Badge"
67+
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.2.2-orange.svg?style=for-the-badge "Lib.rs Badge"
6768
[license-badge]: https://img.shields.io/crates/l/libmake.svg?style=for-the-badge "License Badge"
6869
[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust "Made With Rust Badge"

benches/criterion.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
//! from the `libmake` crate, helping you evaluate and optimize its performance.
3838
3939
#![allow(missing_docs)]
40-
extern crate criterion;
41-
extern crate libmake;
4240

4341
use criterion::{criterion_group, criterion_main, Criterion};
4442
use libmake::run;

examples/generate_from_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ use libmake::generator::generate_from_args;
5353
/// If successful, this program will print "Successfully generated files!".
5454
///
5555
/// If there is an error, it will print an error message.
56-
pub fn main() {
56+
pub(crate) fn main() {
5757
// Simulate command line arguments
5858
let args = "--author=Me --output=my_library"
5959
.split(' ')
60-
.map(std::string::ToString::to_string) // Directly using the method
60+
.map(ToString::to_string) // Directly using the method
6161
.collect::<Vec<String>>();
6262

6363
// Check if there are at least two arguments (program name and at least one option)

examples/generate_from_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use libmake::generator::generate_from_config;
4949
///
5050
/// * `Ok(())` - If generation is successful.
5151
/// * `Err(String)` - If there is an error during generation.
52-
pub fn main() {
52+
pub(crate) fn main() {
5353
// Define the file path for the configuration file.
5454
let file_path = "./tests/data/mylibrary.yaml";
5555

examples/generate_from_csv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ use libmake::generator::generate_from_csv;
5757
/// generate_from_csv(csv_file_path)
5858
/// .expect("Failed to generate the template files");
5959
/// ```
60-
pub fn main() {
60+
pub(crate) fn main() {
6161
// Define the path to the CSV file to be used for testing.
6262
let csv_file_path = "./tests/data/mylibrary.csv";
6363

examples/generate_from_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use libmake::generator::generate_from_json;
4646
///
4747
/// * `Result<(), String>` - Returns `Ok(())` if the template files are generated successfully, or returns an error message if there is an error during generation.
4848
///
49-
pub fn main() {
49+
pub(crate) fn main() {
5050
// Define the path to the JSON file that contains configuration data.
5151
let json_file_path = "./tests/data/mylibrary.json";
5252

examples/generate_from_toml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use libmake::generator::generate_from_toml;
4141
///
4242
/// * `Result<(), String>` - Returns `Ok(())` if the template files are generated successfully, or returns an error message if generation fails.
4343
///
44-
pub fn main() {
44+
pub(crate) fn main() {
4545
// Define the path to the TOML file containing configuration.
4646
let toml_file_path = "./tests/data/mylibrary.toml";
4747

0 commit comments

Comments
 (0)