Skip to content
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

feat: config to silence executable warnings #242

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

ngscheurich
Copy link
Contributor

I'm on macOS and, although the sed on my path is GNU sed, I still see the "You need to install gnu sed 'brew install gnu-sed'" warning. This is because the plugin assumes macOS users will be using the Homebrew package manager and thus checks for the gsed executable. While this is a safe assumption for many (most?) macOS users, folks who are using other package managers, have aliased sed to gsed, etc. will see false positives.

I worked around this in a rather simple way, by adding a warn option that the user can simply set to false if they know better than the plugin. From the doc update:

Warnings are emitted based on your operating system and chosen executables. If you find one of these warnings to be in error, you may silence it by setting the respective warn key. For example, to silence GNU sed warnings:

require('spectre').setup({
    replace_engine={
        ['sed']={
              warn = false,
            }
        },
    }
})

A medium-confidence check for GNU sed, e.g. testing for the existence of the --version flag, could be employed but that adds some execution overhead and a bit more complexity than the solution I'm proposing. Thoughts?

@EpsilonKu EpsilonKu merged commit 9a28f92 into nvim-pack:master Jul 8, 2024
3 checks passed
@ngscheurich ngscheurich deleted the allow-skip-sed-check branch July 15, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants