Skip to content

Commit

Permalink
Add Cargo.toml linting to the CI pipeline (FuelLabs#1139)
Browse files Browse the repository at this point in the history
* Add Cargo.toml linting to the CI pipeline

* Sort deps correctly in Cargo.toml files
  • Loading branch information
Dentosal authored Apr 6, 2022
1 parent bbe2938 commit 8bff086
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ jobs:
command: clippy
args: --all-features --all-targets -- -D warnings

cargo-toml-fmt-check:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-toml-lint
version: "0.1"
- name: Run Cargo.toml linter
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint

cargo-fmt-check:
needs: cancel-previous-runs
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion forc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ serde_json = "1.0.73"
sway-core = { version = "0.9.2", path = "../sway-core" }
sway-fmt = { version = "0.9.2", path = "../sway-fmt" }
sway-lsp = { version = "0.9.2", path = "../sway-lsp" }
sway-utils = { version = "0.9.2", path = "../sway-utils" }
sway-types = { version = "0.9.2", path = "../sway-types" }
sway-utils = { version = "0.9.2", path = "../sway-utils" }
taplo = "0.7"
tar = "0.4.35"
term-table = "1.3"
Expand Down
2 changes: 1 addition & 1 deletion sway-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ either = "1.6"
fuel-asm = "0.3"
fuel-crypto = "0.4"
fuel-vm = "0.6"
generational-arena = "0.2"
hex = { version = "0.4", optional = true }
itertools = "0.10"
lazy_static = "1.4"
Expand All @@ -34,7 +35,6 @@ smallvec = "1.7"
sway-ir = { version = "0.9.2", path = "../sway-ir" }
sway-types = { version = "0.9.2", path = "../sway-types" }
sway-utils = { version = "0.9.2", path = "../sway-utils" }
generational-arena = "0.2"
thiserror = "1.0"

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ fuel-tx = "0.7"
fuel-types = "0.3"
fuel-vm = "0.6"
fuels-abigen-macro = "0.8"
fuels-signers = { version = "0.8", features=["test-helpers"] }
fuels-contract = "0.8"
fuels-core = "0.8"
fuels-signers = { version = "0.8", features=["test-helpers"] }
rand = "0.8"
tokio = { version = "1.12", features = ["rt", "macros"] }

Expand Down
2 changes: 1 addition & 1 deletion sway-lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ description = "LSP server for Sway."
[dependencies]
dashmap = "4.0.2"
forc-util = { version = "0.9.2", path = "../forc-util" }
tower-lsp = "0.16.0"
ropey = "1.2"
serde_json = "1.0.60"
sway-core = { version = "0.9.2", path = "../sway-core" }
sway-fmt = { version = "0.9.2", path = "../sway-fmt" }
sway-types = { version = "0.9.2", path = "../sway-types" }
sway-utils = { version = "0.9.2", path = "../sway-utils" }
tokio = { version = "1.3", features = ["io-std", "io-util", "macros", "net", "rt-multi-thread", "sync", "time"] }
tower-lsp = "0.16.0"

[dev-dependencies]
async-trait = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ fuel-tx = "0.7"
fuel-vm = { version = "0.6", features = ["random"] }
rand = "0.8"
regex = "1"
tokio = "1.12"
serde_json = "1.0.73"
tokio = "1.12"

0 comments on commit 8bff086

Please sign in to comment.