Skip to content

lib/helpers: remove log message from _command_exists() et al #2065

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

Merged
merged 3 commits into from
Apr 30, 2025

Conversation

gaelicWizard
Copy link
Contributor

Description

Completely remove all logging from _command_exists(), _binary_exists(), _completion_exists(), and _is_function().

  • and move them to lib/utilities.

Motivation and Context

These functions are used everywhere and both junk up bash-it doctor, but can alsö add unexpected strings to some theme prompt lines!

It does not seem like the logging was ever used anywhere prior to my converting the codebase to use it, although it was pointed out that this is often used to short-circuit plugin loading and so the default message could be helpful in bash-it doctor. I have a separate PR which adds actual logging to plugins that short-circuit.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@gaelicWizard gaelicWizard force-pushed the lib/utilities branch 2 times, most recently from d3a34ae to a907712 Compare January 31, 2022 00:18
@gaelicWizard gaelicWizard force-pushed the lib/utilities branch 2 times, most recently from 36d1e2b to 156e99c Compare February 13, 2022 23:16
We should fall back to the default location, not use an entirely different one.
Copy link
Contributor

@seefood seefood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me, unless I am missing something big. Isn't this ready for merging?

@seefood seefood added seems abandoned rattle the cage, and close if nobody wants to keep it going waiting-for-response clean up labels Nov 12, 2024
@seefood seefood marked this pull request as ready for review April 30, 2025 12:17
@seefood seefood merged commit 7308748 into Bash-it:master Apr 30, 2025
4 of 6 checks passed
@@ -6,6 +6,71 @@ function local_setup_file() {
setup_libs "helpers"
}

@test "utilities: _is_function: _command_exists" {
run _is_function _command_exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up seems abandoned rattle the cage, and close if nobody wants to keep it going waiting-for-response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants