Skip to content

Commit

Permalink
Use cargo reference manifest section order
Browse files Browse the repository at this point in the history
In [#131] I added a check that ensures that the section in `Cargo.toml`
(and there values) are in a specific order. I invented the order quite
randomly, in the order which I thought might be useful.

This PR changes the order to be the same as in Cargo's reference about
[The Manifest Format]. Also some missing softlinks were added.

[#131]: <#131>
[The Manifest Format]: <https://doc.rust-lang.org/cargo/reference/manifest.html>
  • Loading branch information
Kijewski committed Dec 13, 2024
1 parent b160565 commit b49e42f
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 39 deletions.
7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[workspace]
members = [
"rinja",
"rinja_derive",
"rinja_parser",
"testing",
]
members = ["rinja", "rinja_derive", "rinja_parser", "testing"]
resolver = "2"
9 changes: 5 additions & 4 deletions examples/actix-web-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# In a real application you would not need this section. It is only used in here, so that this
# example can have a more lenient MSRV (minimum supported rust version) than rinja as a whole.
[workspace]
members = ["."]

[package]
name = "actix-web-app"
Expand All @@ -28,3 +24,8 @@ env_logger = "0.11.3"
log = "0.4.22"
pretty-error-debug = "0.3.0"
thiserror = "2.0.3"

# In a real application you would not need this section. It is only used in here, so that this
# example can have a more lenient MSRV (minimum supported rust version) than rinja as a whole.
[workspace]
members = ["."]
6 changes: 3 additions & 3 deletions fuzzing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

[workspace]
members = [".", "fuzz"]
[package]
name = "rinja_fuzzing"
version = "0.1.0"
Expand All @@ -17,3 +14,6 @@ thiserror = "2.0.3"

[profile.release]
debug = 1

[workspace]
members = [".", "fuzz"]
1 change: 1 addition & 0 deletions rinja_derive/.rustfmt.toml
12 changes: 6 additions & 6 deletions rinja_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]
[lib]
proc-macro = true

[features]
code-in-doc = ["dep:pulldown-cmark"]
config = ["dep:serde", "dep:basic-toml", "parser/config"]
urlencode = []
serde_json = []

[dependencies]
parser = { package = "rinja_parser", version = "=0.3.5", path = "../rinja_parser" }

Expand All @@ -44,6 +38,12 @@ prettyplease = "0.2.20"
similar = "2.6.0"
syn = { version = "2.0.3", features = ["full"] }

[features]
code-in-doc = ["dep:pulldown-cmark"]
config = ["dep:serde", "dep:basic-toml", "parser/config"]
urlencode = []
serde_json = []

[lints.rust]
# Used in `rinja_derive_standalone` which uses the same source folder, but is not a proc-macro.
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(feature, values("__standalone"))'] }
1 change: 1 addition & 0 deletions rinja_derive/_typos.toml
1 change: 1 addition & 0 deletions rinja_derive/deny.toml
1 change: 1 addition & 0 deletions rinja_derive/tomlfmt.toml
29 changes: 15 additions & 14 deletions rinja_derive_standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[workspace]
members = ["."]

[package]
name = "rinja_derive_standalone"
Expand All @@ -17,14 +15,10 @@ publish = false
all-features = true
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]

[features]
default = ["__standalone"]
__standalone = []

code-in-doc = ["dep:pulldown-cmark"]
config = ["dep:serde", "dep:basic-toml", "parser/config"]
urlencode = []
serde_json = []
[[bench]]
name = "derive-template"
harness = false
required-features = ["__standalone"]

[dependencies]
parser = { package = "rinja_parser", version = "=0.3.5", path = "../rinja_parser" }
Expand All @@ -48,7 +42,14 @@ prettyplease = "0.2.20"
similar = "2.6.0"
syn = { version = "2.0.3", features = ["full"] }

[[bench]]
name = "derive-template"
harness = false
required-features = ["__standalone"]
[features]
default = ["__standalone"]
__standalone = []

code-in-doc = ["dep:pulldown-cmark"]
config = ["dep:serde", "dep:basic-toml", "parser/config"]
urlencode = []
serde_json = []

[workspace]
members = ["."]
10 changes: 5 additions & 5 deletions rinja_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ rust-version = "1.80"
all-features = true
rustdoc-args = ["--generate-link-to-definition", "--cfg=docsrs"]

[features]
config = ["dep:serde"]
[[bench]]
name = "from_str"
harness = false

[dependencies]
memchr = "2"
Expand All @@ -28,6 +29,5 @@ winnow = "0.4"
[dev-dependencies]
criterion = "0.5"

[[bench]]
name = "from_str"
harness = false
[features]
config = ["dep:serde"]
24 changes: 23 additions & 1 deletion tomlfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
table_order = ["workspace", "package", "badges", "lib", "features", "dependencies", "build-dependencies", "dev-dependencies", "bench"]
# Keep in the same order as <https://doc.rust-lang.org/cargo/reference/manifest.html>
table_order = [
"package",
# targets
"lib",
"bin",
"example",
"test",
"bench",
# dependencies
"dependencies",
"dev-dependencies",
"build-dependencies",
"target",
# misc
"badges",
"features",
"lints",
"patch",
"replace",
"profile",
"workspace",
]

0 comments on commit b49e42f

Please sign in to comment.