cargo-spellcheck icon indicating copy to clipboard operation
cargo-spellcheck copied to clipboard

How to ignore files

Open hanabi1224 opened this issue 2 years ago • 8 comments

** Q: **

What are the CLI options or config fiels that I can use to ignore some .rs files, e.g. those auto-generated by protobuf, thanks!

hanabi1224 avatar Jan 18 '23 17:01 hanabi1224

Generally, generated files should be put under OUT_DIR, which is excluded in .gitignore which is honoured. If you include files as part of your source tree, imho formatting makes sense. Assuming this is output of your build.rs, adding another line formatting it should work.

Would this be feasible or do you have a different use case?

drahnr avatar Jan 18 '23 17:01 drahnr

Generally, generated files should be put under OUT_DIR

One counter-example is rust-libp2p is moving its protobuf generated files to source tree so that it won't require protoc to compile.

imho formatting makes sense.

It's not a formatting issue, but it has invalid words in its comments that are caught by cargo-spellcheck.

What I would like to have is sth like cargo-spellcheck --ignore [glob] --ignore [glob], just like cargo audit

Let me know if my explanations make sense

hanabi1224 avatar Jan 18 '23 18:01 hanabi1224

It does make sense.

What do you think about a regex in the config file which could be part of the repository?

drahnr avatar Jan 18 '23 20:01 drahnr

Either way is good for me. Thanks for accepting this feature request!

btw, IMHO glob patterns would be better and easier than regular expressions

hanabi1224 avatar Jan 18 '23 21:01 hanabi1224

Just bumping this, I have a CSS files with classes that I cannot change which would be nice to ignore.

jmintb avatar Mar 12 '23 13:03 jmintb

Happy to work on this if you think it makes sense for a first time contributor.

jmintb avatar Mar 12 '23 13:03 jmintb

Just bumping this, I have a CSS files with classes that I cannot change which would be nice to ignore.

Sorry I forgot that cargo-spell check is for documentation and comments, it was another tool complaining about the css,

jmintb avatar Mar 12 '23 14:03 jmintb