Skip to content

Commit

Permalink
Improve development experience by moving to a workspace (#410)
Browse files Browse the repository at this point in the history
This allows IDE integration to work when the root of the repository is
opened. Prior to this change, a developer would have to open cargo-insta
to get code completion for that crate.

This also causes clippy to run on all crates, so this commit fixes a few
lints.
  • Loading branch information
tamird committed Oct 9, 2023
1 parent ef00fb6 commit 452fdc4
Show file tree
Hide file tree
Showing 17 changed files with 319 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -24,6 +24,8 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.61.0
- name: Use Cargo.lock.msrv
run: cp Cargo.lock.msrv Cargo.lock
- name: Test
run: make cargotest

Expand Down
222 changes: 221 additions & 1 deletion cargo-insta/Cargo.lock → Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -18,6 +18,9 @@ exclude = [
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[workspace]
members = ["cargo-insta", "cargo-insta/integration-tests"]

[features]
default = ["colors"]

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -12,7 +12,7 @@ cargo-insta-tests:
@echo "CARGO-INSTA INTEGRATION TESTS"
# Turn off CI flag so that cargo insta test behaves as we expect
# under normal operation
@cd cargo-insta/integration-tests; CI=0 cargo run
@CI=0 cargo test -p integration-tests

cargotest:
@echo "CARGO TESTS"
Expand All @@ -21,7 +21,7 @@ cargotest:
@cargo test --all-features
@cargo test --no-default-features
@cargo test --features redactions -- --test-threads 1
@cd cargo-insta; cargo test
@cargo test -p cargo-insta

check-minver:
@echo "MINVER CHECK"
Expand All @@ -40,6 +40,6 @@ format-check:

lint:
@rustup component add clippy 2> /dev/null
@cargo clippy
@cargo clippy --all-targets --workspace -- --deny warnings

.PHONY: all doc test cargotest format format-check lint update-readme
1 change: 0 additions & 1 deletion cargo-insta/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions cargo-insta/integration-tests/.gitignore

This file was deleted.

0 comments on commit 452fdc4

Please sign in to comment.