bolt icon indicating copy to clipboard operation
bolt copied to clipboard

[Bug] Incorrect dependency syntax in Cargo.toml when installing Bolt components/systems

Open dellwatson opened this issue 8 months ago • 1 comments

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:

  1. Install a new component or system using Bolt CLI
  2. Check the generated/updated Cargo.toml file
  3. Observe that some dependencies use incorrect syntax: dependency.workspace = true instead of dependency = { 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.

dellwatson avatar Apr 16 '25 09:04 dellwatson

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?

notdanilo avatar Apr 24 '25 16:04 notdanilo

@dellwatson you are probably using an older version of clippy/cargo. I am closing this issue since it's inactive.

notdanilo avatar Jul 28 '25 15:07 notdanilo