drahnr / cargo-spellcheck

Checks all your documentation for spelling and grammar mistakes with hunspell and a nlprule based checker for grammar
Apache License 2.0
314 stars 32 forks source link

Spellcheck doesn't list files when edition is inherited #301

Closed LesnyRumcajs closed 1 year ago

LesnyRumcajs commented 1 year ago

Describe the bug

The spellcheck doesn't follow crates where the edition is inherited from the workspace.

To Reproduce

Steps to reproduce the behaviour:

[package]
name = "forest_ipld"
description = "Interplanetary linked data types and implementation"
license.workspace = true
repository.workspace = true
version.workspace = true
authors.workspace = true
edition.workspace = true

forest_ipld is a workspace member where the edition is defined as edition = "2021".

Running cargo spellcheck list-files doesn't yield anything for this crate.

❯ cargo spellcheck list-files
/home/rumcajs/prj/forest-s2/node/forest_libp2p/bitswap/examples/bitswap-in-browser/src/main.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/main.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/cli/mod.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/daemon.rs

After changing edition.workspace = true to an explicit edition = "2021", it works fine.

❯ cargo spellcheck list-files
/home/rumcajs/prj/forest-s2/node/forest_libp2p/bitswap/examples/bitswap-in-browser/src/main.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/main.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/daemon.rs
/home/rumcajs/prj/forest-s2/forest/daemon/src/cli/mod.rs
/home/rumcajs/prj/forest-s2/ipld/src/lib.rs
/home/rumcajs/prj/forest-s2/ipld/src/cid_hashset.rs
/home/rumcajs/prj/forest-s2/ipld/src/json.rs
/home/rumcajs/prj/forest-s2/ipld/src/error.rs
/home/rumcajs/prj/forest-s2/ipld/src/selector/mod.rs
/home/rumcajs/prj/forest-s2/ipld/src/util.rs
/home/rumcajs/prj/forest-s2/ipld/src/selector/empty_map.rs
/home/rumcajs/prj/forest-s2/ipld/src/selector/walk.rs

Workspace: https://github.com/ChainSafe/forest/blob/main/Cargo.toml Member: https://github.com/ChainSafe/forest/blob/e499495776762060ddc22bf308d869f754c85ee5/ipld/Cargo.toml

Expected behavior cargo spellcheck list-files also works when the edition is inherited from the workspace.

Screenshots

Please complete the following information:

Additional context

The workaround is to use an explicit edition for all members. https://github.com/ChainSafe/forest/pull/2702

drahnr commented 1 year ago

Fixed with #31 - at least I cannot reproduce with that version. I'll cut a release shortly.

# cargo spellcheck list-files | rg ipld                                                                                                                                                         
/tmp/forest/ipld/src/lib.rs
/tmp/forest/ipld/src/selector/mod.rs
/tmp/forest/ipld/src/cid_hashset.rs
/tmp/forest/ipld/src/json.rs
/tmp/forest/ipld/src/util.rs
/tmp/forest/ipld/src/error.rs
/tmp/forest/ipld/src/selector/empty_map.rs
/tmp/forest/ipld/src/selector/walk.rs
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: ipld/Cargo.toml
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [package]
   2   │ name = "forest_ipld"
   3   │ description = "Interplanetary linked data types and implementation"
   4   │ license.workspace = true
   5   │ repository.workspace = true
   6   │ version.workspace = true
   7   │ authors.workspace = true
   8   │ edition.workspace = true
   9   │ 
  10   │ [dependencies]
  11   │ ahash.workspace = true
  12   │ anyhow.workspace = true
  13   │ async-recursion = "1.0"
  14   │ async-trait.workspace = true
  15   │ cid.workspace = true
  16   │ forest_blocks.workspace = true
  17   │ fvm_ipld_encoding.workspace = true
  18   │ fvm_shared = { workspace = true, default-features = false }
  19   │ indexmap.workspace = true
  20   │ libipld-core = { workspace = true, features = ["serde-codec"] }
  21   │ libipld-macro.workspace = true
  22   │ libipld.workspace = true
  23   │ multibase.workspace = true
  24   │ serde = { workspace = true, features = ["derive"] }
  25   │ thiserror.workspace = true
  26   │ 
  27   │ [dev-dependencies]
  28   │ forest_db.workspace = true
  29   │ forest_json.workspace = true
  30   │ forest_utils.workspace = true
  31   │ multihash = { workspace = true, default-features = false, features = ["identity"] }
  32   │ quickcheck.workspace = true
  33   │ quickcheck_macros.workspace = true
  34   │ serde_json.workspace = true
  35   │ tokio.workspace = true
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
drahnr commented 1 year ago

Could you retry with v0.12.4?

LesnyRumcajs commented 1 year ago

@drahnr Yeah, it looks good now. Thanks a lot; it would also be great to release it on crates.io. Cheers! :)