extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
184 stars 27 forks source link

[TOML] Add a line break between tables #55

Closed yutannihilation closed 3 years ago

yutannihilation commented 3 years ago

This is the TOML file generated by rextendr::use_extendr().

[package]
name = 'helloextendr'
version = '0.1.0'
edition = '2018'
[lib]
crate-type = [ 'staticlib' ]
[dependencies]
extendr-api = '*'

This might be just my preference, but I think it's more readable if there's an empty line between tables.

[package]
name = 'helloextendr'
version = '0.1.0'
edition = '2018'

[lib]
crate-type = [ 'staticlib' ]

[dependencies]
extendr-api = '*'

This can be done by concatenating each table to a single string, instead of flattening them. Here's my naive attempt (note that array of tables needs a bit more tweak):

https://github.com/yutannihilation/rextendr/commit/12611cd5455e90f79b09b84d0133c6bd8cff2afc

clauswilke commented 3 years ago

Feel free to make a PR. Since we're using glue throughout, I'd use its functions instead of paste() and paste0().

yutannihilation commented 3 years ago

Sure, I'll take care of the existing paste() as well then.