[Bug] Incorrect dependency syntax in Cargo.toml when installing Bolt components/systems
Describe the bug
When installing components or systems via Bolt, it sometimes incorrectly formats dependency imports in Cargo.toml files. Specifically, it uses the invalid syntax bolt-lang.workspace = true instead of the correct bolt-lang = { workspace = true }.
To Reproduce
Steps to reproduce the behavior:
- Install a new component or system using Bolt CLI
- Check the generated/updated Cargo.toml file
- Observe that some dependencies use incorrect syntax:
dependency.workspace = trueinstead ofdependency = { workspace = true }
Expected behavior
All dependencies in generated Cargo.toml files should use the correct syntax:
- Correct:
bolt-lang = { workspace = true } - Incorrect:
bolt-lang.workspace = true
Screenshots
Linter error in Cargo.toml:
File Name: programs-ecs/systems/join-room-system/Cargo.toml
Errors:
22 |
23 | [dependencies]
24 | bolt-lang.workspace = true
Err | Expected "=", [ \t] or [A-Za-z0-9_\-] but "." found.
25 | serde = { version = "1.0", features = ["derive"] }
Additional context
After installing components or systems with Bolt, it doesn't consistently auto-import dependencies with the correct syntax in the related Cargo.toml files, causing compilation errors that need manual fixing.
This is weird because bolt-lang.workspace = true is not an invalid toml syntax. I will check what is the confusion here. What linter are you using?
@dellwatson you are probably using an older version of clippy/cargo. I am closing this issue since it's inactive.