Skip to content

Commit

Permalink
H-3570: Provide formatter for *.toml files (#5624)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDiekmann authored Nov 11, 2024
1 parent fc47a2d commit cd70f66
Show file tree
Hide file tree
Showing 27 changed files with 134 additions and 83 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ jobs:
exit 1
fi
- name: Run yarn lint:taplo
if: ${{ success() || failure() }}
run: |
if ! yarn lint:taplo; then
echo ''
echo ''
echo 'ℹ️ ℹ️ ℹ️'
echo 'Try running `yarn fix:taplo` locally to apply autofixes.'
echo 'ℹ️ ℹ️ ℹ️'
exit 1
fi
## TODO: Replace with `yarn fix:yarn-dedupe` after upgrading to Yarn v3+
## https://yarnpkg.com/cli/dedupe
## https://github.com/yarnpkg/berry/issues/2297
Expand Down
31 changes: 31 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
exclude = ["node_modules/**"]
include = ["**/Cargo.toml", ".taplo.toml"]

[formatting]
align_comments = false
array_auto_collapse = false
array_auto_expand = false
indent_string = " "
inline_table_expand = false

[[rule]]
include = ["**/Cargo.toml"]
keys = ["dependencies", "workspace.dependencies"]

[rule.formatting]
reorder_keys = true

[[rule]]
include = ["**/Cargo.toml"]
keys = ["workspace"]

[rule.formatting]
reorder_arrays = true
reorder_keys = true

[[rule]]
include = [".taplo.toml"]

[rule.formatting]
align_entries = true
reorder_keys = true
60 changes: 30 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cargo-features = ["edition2024"]

[workspace]
default-members = [
"apps/hash-graph",
]
members = [
"apps/hash-graph",
"libs/@blockprotocol/type-system/rust",
Expand Down Expand Up @@ -41,24 +44,29 @@ members = [
"tests/graph/integration",
"tests/graph/test-data/rust",
]
default-members = [
"apps/hash-graph",
]
resolver = "3"

[workspace.package]
authors = ["HASH"]
version = "0.0.0"
edition = "2024"
license = "AGPL-3"
publish = false
version = "0.0.0"

[workspace.dependencies]
# Workspace members
error-stack = { path = "./libs/error-stack", default-features = false }
harpc-client.path = "libs/@local/harpc/client"
harpc-codec.path = "libs/@local/harpc/codec"
harpc-net.path = "libs/@local/harpc/net"
harpc-server.path = "libs/@local/harpc/server"
harpc-system.path = "libs/@local/harpc/system"
harpc-tower.path = "libs/@local/harpc/tower"
harpc-types.path = "libs/@local/harpc/types"
harpc-wire-protocol.path = "libs/@local/harpc/wire-protocol"
hash-codec.path = "libs/@local/codec"
hash-graph-authorization.path = "libs/@local/graph/authorization"
hash-graph-api.path = "libs/@local/graph/api"
hash-graph-authorization.path = "libs/@local/graph/authorization"
hash-graph-postgres-store.path = "libs/@local/graph/postgres-store"
hash-graph-store.path = "libs/@local/graph/store"
hash-graph-temporal-versioning.path = "libs/@local/graph/temporal-versioning"
Expand All @@ -69,16 +77,8 @@ hash-graph-type-fetcher.path = "libs/@local/graph/type-fetcher"
hash-graph-types.path = "libs/@local/graph/types/rust"
hash-graph-validation.path = "libs/@local/graph/validation"
hash-repo-chores.path = "libs/@local/repo-chores/rust"
hash-temporal-client.path = "libs/@local/temporal-client"
harpc-net.path = "libs/@local/harpc/net"
harpc-types.path = "libs/@local/harpc/types"
harpc-wire-protocol.path = "libs/@local/harpc/wire-protocol"
harpc-tower.path = "libs/@local/harpc/tower"
harpc-system.path = "libs/@local/harpc/system"
harpc-codec.path = "libs/@local/harpc/codec"
harpc-server.path = "libs/@local/harpc/server"
harpc-client.path = "libs/@local/harpc/client"
hash-status.path = "libs/@local/status/rust"
hash-temporal-client.path = "libs/@local/temporal-client"
hash-tracing.path = "libs/@local/tracing"
hql-cst.path = "libs/@local/hql/cst"
hql-diagnostics.path = "libs/@local/hql/diagnostics"
Expand Down Expand Up @@ -106,30 +106,33 @@ futures-core = { version = "=0.3.31", default-features = false }
futures-io = { version = "=0.3.31", default-features = false }
futures-sink = { version = "=0.3.31", default-features = false }
futures-util = { version = "=0.3.31", default-features = false }
hashbrown = { version = "=0.15.1", default-features = false, features = ["nightly", "inline-more"] }
hashbrown = { version = "=0.15.1", default-features = false, features = ["inline-more", "nightly"] }
http = { version = "=1.1.0", default-features = false }
inferno = { version = "=0.11.21", default-features = false }
iso8601-duration = { version = "=0.2.0", default-features = false }
json-number = { version = "=0.4.9", default-features = false }
jsonptr = { version = "=0.6.3", default-features = false }
multiaddr = { version = "=0.18.2", default-features = false }
multistream-select = { version = "=0.13.0", default-features = false }
libp2p-core = { version = "=0.42.0", default-features = false }
libp2p-identity = { version = "=0.2.9", default-features = false }
libp2p-ping = { version = "=0.45.0", default-features = false }
libp2p-swarm = { version = "=0.45.1", default-features = false }
libp2p-yamux = { version = "=0.46.0", default-features = false }
prometheus-client = { version = "=0.22.3", default-features = false }
multiaddr = { version = "=0.18.2", default-features = false }
multistream-select = { version = "=0.13.0", default-features = false }
postgres-types = { version = "=0.2.8", default-features = false }
reqwest = { version = "=0.12.9", default-features = false, features = ["rustls-tls"] }
prometheus-client = { version = "=0.22.3", default-features = false }
regex = { version = "=1.11.1", default-features = false, features = ["perf", "unicode"] }
reqwest = { version = "=0.12.9", default-features = false, features = ["rustls-tls"] }
semver = { version = "=1.0.23", default-features = false }
sentry-types = { version = "=0.34.0", default-features = false }
serde = { version = "=1.0.214", default-features = false }
serde_json = { version = "=1.0.132" }
text-size = { version = "=1.1.1", default-features = false }
time = { version = "=0.3.36", default-features = false }
tokio = { version = "=1.41.1", default-features = false }
tokio-postgres = { version = "=0.7.12", default-features = false }
tokio-util = { version = "=0.7.12", default-features = false }
tower-http = { version = "=0.6.1", features = ["trace"] }
tower-layer = { version = "=0.3.3", default-features = false }
tower-service = { version = "=0.3.3", default-features = false }
tracing-appender = { version = "=0.2.3", default-features = false }
Expand All @@ -138,9 +141,6 @@ tracing-subscriber = { version = "=0.3.18", default-features = false }
url = { version = "=2.5.3", default-features = false }
utoipa = { version = "=4.2.3", default-features = false }
uuid = { version = "=1.11.0", default-features = false }
time = { version = "=0.3.36", default-features = false }
tokio-postgres = { version = "=0.7.12", default-features = false }
tower-http = { version = "=0.6.1", features = ["trace"] }

# Shared third-party dependencies
ansi-to-html = { version = "=0.2.1", default-features = false }
Expand All @@ -153,12 +153,12 @@ aws-config = { version = "=1.5.10" }
aws-sdk-s3 = { version = "=1.60.0", default-features = false }
bitvec = { version = "=1.0.1", default-features = false }
bytes-utils = { version = "=0.1.4", default-features = false }
clap = { version = "=4.5.20", features = ["std", "color", "help", "usage", "error-context", "suggestions"] }
clap = { version = "=4.5.20", features = ["color", "error-context", "help", "std", "suggestions", "usage"] }
clap_complete = { version = "=4.5.37", default-features = false }
coverage-helper = { version = "=0.2.2", default-features = false }
criterion-macro = { version = "=0.4.0", default-features = false }
derive_more = { version = "=1.0.0", default-features = false }
derive-where = { version = "=1.2.7", default-features = false, features = ["nightly"] }
derive_more = { version = "=1.0.0", default-features = false }
dotenv-flow = { version = "=0.16.2", default-features = false }
expect-test = { version = "=1.5.0", default-features = false }
futures = { version = "=0.3.31", default-features = false }
Expand Down Expand Up @@ -194,7 +194,7 @@ rand = { version = "=0.8.5", default-features = false }
refinery = { version = "=0.8.14", default-features = false }
rustc_version = { version = "=0.4.1", default-features = false }
scc = { version = "=2.2.4", default-features = false }
sentry = { version = "=0.34.0", default-features = false, features = ["backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls", "tracing", "tower-http"] }
sentry = { version = "=0.34.0", default-features = false, features = ["backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls", "tower-http", "tracing"] }
seq-macro = { version = "=0.3.5", default-features = false }
serde_plain = { version = "=1.0.2", default-features = false }
serde_with = { version = "=3.11.0", default-features = false }
Expand All @@ -213,11 +213,11 @@ tokio-stream = { version = "=0.1.16", default-features = false }
tokio-test = { version = "=0.4.4", default-features = false }
tower = { version = "=0.5.1", default-features = false }
tower-test = { version = "=0.4.0", default-features = false }
trait-variant = { version = "=0.1.2", default-features = false }
tracing = { version = "=0.1.40", default-features = false }
tracing-error = { version = "=0.2.0", default-features = false }
tracing-flame = { version = "=0.2.0", default-features = false }
tracing-opentelemetry = { version = "=0.27.0", default-features = false }
trait-variant = { version = "=0.1.2", default-features = false }
trybuild = { version = "=1.0.101", default-features = false }
tsify = { version = "=0.4.5", default-features = false }
unicode-ident = { version = "=1.0.13", default-features = false }
Expand All @@ -241,20 +241,20 @@ codegen-backend = "llvm"

# We use `llvm-cov` which requires LLVM`
[profile.coverage]
inherits = "test"
codegen-backend = "llvm"
inherits = "test"

[profile.production]
inherits = "release"
lto = "fat"
strip = "none"

[workspace.lints.rust]
nonstandard_style = { level = "warn", priority = -1 }
future_incompatible = { level = "warn", priority = -1 }
nonstandard_style = { level = "warn", priority = -1 }

unsafe_code = "deny"
unreachable_pub = "warn"
unsafe_code = "deny"

[workspace.lints.cargo]

Expand Down Expand Up @@ -314,8 +314,8 @@ module_name_repetitions = "allow"
pub_use = "allow"
pub_with_shorthand = "allow" # Opposite of `clippy::pub_without_shorthand`
question_mark_used = "allow"
ref_patterns = "allow"
redundant_pub_crate = "allow" # Opposite of `unreachable_pub`
ref_patterns = "allow"
semicolon_outside_block = "allow" # Opposite of `clippy::semicolon_inside_block`
separated_literal_suffix = "allow" # Opposite of `clippy::unseparated_literal_suffix`
shadow_reuse = "allow"
Expand Down
12 changes: 6 additions & 6 deletions apps/hash-graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ package-name = "@apps/hash-graph"

[dependencies]
# Workspace dependencies
hash-codec = { workspace = true }
error-stack = { workspace = true }
hash-graph-postgres-store = { workspace = true, features = ["clap"] }
harpc-codec = { workspace = true, features = ["json"] }
harpc-server = { workspace = true }
hash-codec = { workspace = true }
hash-graph-api = { workspace = true }
hash-graph-authorization = { workspace = true }
hash-graph-postgres-store = { workspace = true, features = ["clap"] }
hash-graph-store = { workspace = true }
hash-graph-test-server = { workspace = true, optional = true }
hash-graph-type-fetcher = { workspace = true }
hash-graph-types = { workspace = true }
hash-graph-test-server = { workspace = true, optional = true }
hash-temporal-client = { workspace = true }
hash-tracing = { workspace = true, features = ["clap"] }
type-system = { workspace = true }
harpc-codec = { workspace = true, features = ["json"] }
harpc-server = { workspace = true }

# Third party dependencies
axum = { workspace = true }
clap = { workspace = true, features = ["cargo", "derive", "env", "wrap_help"] }
clap_complete = { workspace = true }
futures = { workspace = true }
mimalloc = { workspace = true }
multiaddr = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true, features = ["rustls-tls"] }
tarpc = { workspace = true, features = [
Expand All @@ -49,7 +50,6 @@ tokio = { workspace = true }
tokio-postgres = { workspace = true }
tokio-util = { workspace = true, features = ["codec"] }
tracing = { workspace = true }
multiaddr = { workspace = true }

[features]
test-server = ["dep:hash-graph-test-server"]
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/codec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ serde = { workspace = true, public = true, optional = true }

# Public third-party dependencies
bytes = { workspace = true, public = true }
tokio-util = { workspace = true, public = true, optional = true, features = ["codec"] }
regex = { workspace = true, public = true, optional = true }
tokio-util = { workspace = true, public = true, optional = true, features = ["codec"] }

# Private workspace dependencies

Expand Down
10 changes: 5 additions & 5 deletions libs/@local/graph/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ path = "src/bin/openapi-spec-generator.rs"

[dependencies]
# Public workspace dependencies
hash-graph-postgres-store = { workspace = true, public = true, features = ["utoipa"] }
harpc-client = { workspace = true, public = true }
harpc-server = { workspace = true, public = true }
hash-graph-authorization = { workspace = true, public = true }
hash-graph-postgres-store = { workspace = true, public = true, features = ["utoipa"] }
hash-graph-store = { workspace = true, features = ["utoipa"] }
hash-graph-type-fetcher = { workspace = true, public = true }
hash-graph-types = { workspace = true, public = true, features = ["utoipa"] }
hash-temporal-client = { workspace = true, public = true }
harpc-server = { workspace = true, public = true }
harpc-client = { workspace = true, public = true }

# Public third-party dependencies
axum = { workspace = true, public = true }
axum-core = { workspace = true, public = true }
error-stack = { workspace = true, features = ["futures", "spantrace", "unstable"] }
http = { workspace = true, public = true }
tower-http = { workspace = true, public = true }
tracing = { workspace = true, public = true }
error-stack = { workspace = true, features = ["futures", "spantrace", "unstable"] }

# Private workspace dependencies
harpc-codec = { workspace = true }
harpc-system = { workspace = true }
harpc-tower = { workspace = true }
harpc-types = { workspace = true }
hash-status = { workspace = true }
hash-graph-temporal-versioning = { workspace = true }
hash-graph-type-defs = { workspace = true }
hash-status = { workspace = true }
type-system = { workspace = true, features = ["utoipa"] }

# Private third-party dependencies
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/graph/authorization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ hash-graph-types = { workspace = true, public = true }
futures-core = { workspace = true, public = true }

# Private workspace dependencies
error-stack = { workspace = true, features = ["unstable"] }
hash-codec = { workspace = true }
type-system = { workspace = true }
error-stack = { workspace = true, features = ["unstable"] }

# Private third-party dependencies
derive-where = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/graph/postgres-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ tokio = { workspace = true, public = true, features = ["macros"] }
tokio-postgres = { workspace = true, public = true }

# Private workspace dependencies
hash-codec = { workspace = true }
error-stack = { workspace = true, features = ["std", "serde", "unstable"] }
hash-status = { workspace = true }
hash-codec = { workspace = true }
hash-graph-temporal-versioning = { workspace = true, features = ["postgres"] }
hash-graph-types = { workspace = true, features = ["postgres"] }
hash-status = { workspace = true }
type-system = { workspace = true, features = ["postgres"] }

# Private third-party dependencies
Expand Down
8 changes: 4 additions & 4 deletions libs/@local/graph/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ hash-graph-authorization = { workspace = true, public = true }
hash-temporal-client = { workspace = true, public = true }

# Public third-party dependencies
utoipa = { workspace = true, public = true, optional = true }
postgres-types = { workspace = true, public = true, optional = true, features = ["derive", "with-serde_json-1", "with-uuid-1"] }
tokio-postgres = { workspace = true, public = true, optional = true}
tokio-postgres = { workspace = true, public = true, optional = true }
utoipa = { workspace = true, public = true, optional = true }

# Private workspace dependencies
hash-graph-temporal-versioning = { workspace = true }
type-system = { workspace = true }
hash-graph-types = { workspace = true }
type-system = { workspace = true }

# Private third-party dependencies
bytes = { workspace = true, optional = true }
derive_more = { workspace = true, features = ["display", "error"] }
derive-where = { workspace = true }
derive_more = { workspace = true, features = ["display", "error"] }
futures = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/graph/temporal-versioning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ authors.workspace = true

# Public third-party dependencies
bytes = { workspace = true, public = true, optional = true }
time = { workspace = true, public = true, features = ["serde", "parsing", "formatting", "macros"] }
postgres-types = { workspace = true, public = true, features = ["with-time-0_3"], optional = true }
time = { workspace = true, public = true, features = ["serde", "parsing", "formatting", "macros"] }
utoipa = { workspace = true, public = true, optional = true }

# Private workspace dependencies
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/graph/test-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ description = "HASH Graph test server"

# Private workspace dependencies
error-stack = { workspace = true }
hash-graph-postgres-store = { workspace = true, features = ["utoipa"] }
hash-codec = { workspace = true }
hash-graph-authorization = { workspace = true }
hash-graph-api = { workspace = true }
hash-graph-authorization = { workspace = true }
hash-graph-postgres-store = { workspace = true, features = ["utoipa"] }
hash-graph-store = { workspace = true }
hash-graph-type-defs = { workspace = true }
hash-graph-types = { workspace = true, features = ["utoipa"] }
Expand Down
Loading

0 comments on commit cd70f66

Please sign in to comment.