chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
69 stars 16 forks source link

Adding attributes to catch stray debug prints before merging #154

Open MitchellBerend opened 1 year ago

MitchellBerend commented 1 year ago

Resolves #148 Resolves #156

This pr does not actually resolve any issue but it will prevent stray debug println from being commited to the main branch in the future.

This pr adds attributes to all the modules imported in src/lib.rs. These attributes prevent stray debug println!s from making it into the main branch.

For future reference, you can annotate your function or method with the following attribute so clippy passes ci:

#[allow(clippy::print_stdout)]
fn your_function() {}

Additional tasks

- [ ] Documentation for changes provided/changed - [ ] Tests added - [ ] Updated CHANGELOG.md

MitchellBerend commented 1 year ago

@MitchellBerend The issue is about removing extra calls and it's now resolved by @jim4067 in https://github.com/chshersh/tool-sync/pull/152. Could you open a separate issue about clippy warnings so we don't lose this useful info until we improve our DX? I didn't have the chance to look into it yet disappointed Also, IIUC, it should be enough to put these clippy options only in src/lib.rs to apply them to the entire tool-sync which is not that bad actually. So maybe we can do this instead of patching our CI config thinking MitchellBerend reacted with thumbs up emoji

@chshersh You were right with this. This needs to be added at the top of src/lib.rs

#![deny(clippy::print_stdout)]

#[deny(clippy::print_stdout)]
mod completion;
#[deny(clippy::print_stdout)]
mod config;
#[deny(clippy::print_stdout)]
mod infra;
#[deny(clippy::print_stdout)]
mod install;
#[deny(clippy::print_stdout)]
mod model;
#[deny(clippy::print_stdout)]
mod sync;