Skip to content

Conversation

divoxx
Copy link

@divoxx divoxx commented Oct 11, 2025

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 and cargo test, and the suggested pre-push hook

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Related: #23659

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

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.
@github-actions github-actions bot added domain: external docs Anything related to Vector's external, public documentation domain: vdev Anything related to the vdev tooling labels Oct 11, 2025
Comment on lines +5 to +11
// 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,
Copy link
Author

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.

@divoxx divoxx marked this pull request as ready for review October 11, 2025 22:13
@divoxx divoxx requested review from a team as code owners October 11, 2025 22:13
Copy link
Member

@pront pront left a 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: [{},
Copy link
Member

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?

@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation domain: vdev Anything related to the vdev tooling no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants