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

Development: make lint always fails using GNU grep 3.8 or later #3635

Closed
matthewhughes934 opened this issue Jan 25, 2024 · 5 comments · Fixed by #3666
Closed

Development: make lint always fails using GNU grep 3.8 or later #3635

matthewhughes934 opened this issue Jan 25, 2024 · 5 comments · Fixed by #3666

Comments

@matthewhughes934
Copy link
Contributor

Output of make lint

$ make lint
==> Running linting tools
Running vint ... SKIPPED
'vint' binary not found; use 'pip install vim-vint' to install it.
Running vim-vimlint ... FAILED
egrep: warning: egrep is obsolescent; using grep -E

Running vimhelplint ... PASSED
make: *** [Makefile:21: lint] Error 6

This failure is because the Running vim-vimlint step is marked as failed when any output is captured

if [ -n "$lint" ]; then

But vim-vimlint uses egrep when run https://github.com/syngan/vim-vimlint/blob/cec40c28f119a5f4b92ceb0b6aae525122a81244/bin/vimlint.sh#L106 since GNU grep 3.8 egrep is deprecated and emits a warning https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html which is then captured, resulting in failure.

Since https://github.com/syngan/vim-vimlint has not been updated in 6 years I don't imagine we can patch there. Maybe the lint script could check the exit code of vimlin-lint instead?

@bhcleek
Copy link
Collaborator

bhcleek commented Jan 25, 2024

Yes, I agree that it looks like we could shift to checking the exit code to be sure that it's 2. I also think it's worth submitting a PR to vim-vimlint to use grep -E instead of egrep in an attempt to avoid a more complete future breakage.

@matthewhughes934
Copy link
Contributor Author

I also think it's worth submitting a PR to vim-vimlint to use grep -E instead of egrep in an attempt to avoid a more complete future breakage.

👍 syngan/vim-vimlint#124 though I'm not too optimistic about it being reviewed/merged any time soon 😅

@bhcleek
Copy link
Collaborator

bhcleek commented Mar 27, 2024

I'm having a hard time duplicating this.

vim-go@bc579251da29:~$ make lint
==> Running linting tools
Running vint ... PASSED
Running vim-vimlint ... PASSED
Running vimhelplint ... PASSED
vim-go@bc579251da29:~$ grep --version
grep (GNU grep) 3.8
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
vim-go@bc579251da29:~$ egrep --version
grep (GNU grep) 3.8
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
vim-go@bc579251da29:~$

@matthewhughes934
Copy link
Contributor Author

matthewhughes934 commented Mar 28, 2024

I'm having a hard time duplicating this.

Is your version of grep packaged by Debian/are you running on a Debian based distro? It looks like they have a patch to suppress that warning

Equivalently: does egrep --version emit a warning for you? For reference, I'm running on Arch:

$ docker run archlinux:latest egrep --version >/dev/null
egrep: warning: egrep is obsolescent; using grep -E
$ docker run debian:latest egrep --version >/dev/null

@bhcleek
Copy link
Collaborator

bhcleek commented Mar 28, 2024

Ah, yup, that would do it. Thank you 🙇 .

bhcleek added a commit to bhcleek/vim-go that referenced this issue Jun 3, 2024
Change scripts/lint to handle the deprecation warning about egrep that's
reported on recent non-Debian systems by checking the exit code
explicitly instead of merely checking for the presence of output.

Fixes fatih#3635
bhcleek added a commit to bhcleek/vim-go that referenced this issue Jun 5, 2024
Change scripts/lint to handle the deprecation warning about egrep that's
reported on recent non-Debian systems by checking the exit code
explicitly instead of merely checking for the presence of output.

Fixes fatih#3635
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 a pull request may close this issue.

2 participants