-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[clippy allow cleanup] Clean up clippy allows for vdev #23991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Disabling module_name_repetitions did not yield any clippy errors. Reference: https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
Move the clippy::print_stdout allow directive from global scope to the commands module where stdout printing is actually needed. This ensures print statements are only used where appropriate for CLI output.
Relocates the clippy::unused_self allow from main.rs to the commands module where it's actually needed.
Moves the clippy::unnecessary_wraps allow from the crate level to the commands module where it's actually needed. Command exec() methods return Result<()> for consistency even when they cannot fail, enabling uniform error handling across the command interface.
Run `make generate-component-docs` to update documentation for components.
// The cli_commands! macro generates exec() methods for all commands. Some commands | ||
// use self while others don't, so we allow unused_self to avoid false warnings. | ||
clippy::unused_self, | ||
// All command exec() methods return Result<()> for consistency, even when they | ||
// cannot fail. This allows uniform error handling across the command interface. | ||
clippy::unnecessary_wraps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the macro cli_commands
require these, as some of the implementations does require accessing self
or returning an error. Because of that, I simply moved these so that it applies only for the commands module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @divoxx
required: false | ||
type: object: { | ||
examples: [{}] | ||
examples: [{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run make generate-component-docs
again?
Summary
First PR tackling the investigation and clean up of clippy allows in the repository.
As a first pass, this removes the allows that are possible to remove and narrows the scopes of the ones which are currently required.
Vector configuration
How did you test this PR?
cargo clippy
andcargo test
, and the suggestedpre-push
hookChange Type
Is this a breaking change?
Does this PR include user facing changes?
no-changelog
label to this PR.References
Related: #23659
Notes
@vectordotdev/vector
to reach out to us regarding this PR.pre-push
hook, please see this template.make fmt
make check-clippy
(if there are failures it's possible some of them can be fixed withmake clippy-fix
)make test
git merge origin master
andgit push
.Cargo.lock
), pleaserun
make build-licenses
to regenerate the license inventory and commit the changes (if any). More details here.