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
320 stars 33 forks source link

Is there a way to ignore commented out code? #317

Closed dutterbutter closed 10 months ago

dutterbutter commented 10 months ago

Q:

Currently when making use of:

# Also take into account developer comments
dev_comments = true

It will rightfully capture commented out code like below:

// let overhead_for_block_gas = U256::from(crate::transaction_data::block_overhead_gas(
//     gas_per_pubdata_byte_limit,
// ));

I don't want to add all this commented code to the dictionary, or ignore the entire file and I need to keep this commented code for the time being. Is there a way to ignore commented out code like the above? I explored the docs but didnt see anything.

Thanks in advance and appreciate the work done with cargo-spellcheck 🙏

drahnr commented 10 months ago

Hey @dutterbutter , that is unfortunately a very difficult problem, disambiguating regular text from user input without pulling out medium-sized machine learning based detectors, which is a bit too big for this project.

I don't have a good solution, only workarounds that will inconvenience you to some degree and not work in all cases:

I obviously lack significant amount of context, so to the degree all/any of the above applies varies significantly.

dutterbutter commented 10 months ago

Appreciate the response here ❤️ Thanks!