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

fix(make): exclude makefile variable from completion and handle multiple targets in a rule #248

Merged
merged 6 commits into from
Oct 5, 2024

Conversation

braineo
Copy link
Contributor

@braineo braineo commented Oct 4, 2024

https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html

Makefile variables can be defined as

red:=$(shell echo -e "\033[0;31m")

this change uses negative lookahead to exclude := patterns

also added support for multi-target case

https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html

bigoutput littleoutput : text.g
        generate text.g -$(subst output,,$@) > $@

src/completers/make.zsh Outdated Show resolved Hide resolved
@braineo
Copy link
Contributor Author

braineo commented Oct 4, 2024

@chitoku-k done, upgraded the regex to deal with one more case

@braineo braineo changed the title fix(make): exclude makefile variable from completion fix(make): exclude makefile variable from completion and handle multiple targets in a rule Oct 4, 2024
@chitoku-k
Copy link
Owner

@braineo Seems good! Could you also update the test case (tests/make.zunit) rather than describing the patterns as comment?

@braineo
Copy link
Contributor Author

braineo commented Oct 5, 2024

@braineo Seems good! Could you also update the test case (tests/make.zunit) rather than describing the patterns as comment?

no problem. TIL. interesting behavior difference for gawk and mawk, i wrote 3 different versions of the same awk script

@braineo
Copy link
Contributor Author

braineo commented Oct 5, 2024

as for the comment that's my personal habit. i always forget why i wrote the (slightly
complicated) regexp in that way after 3 weeks.

Copy link
Owner

@chitoku-k chitoku-k left a comment

Choose a reason for hiding this comment

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

TIL. interesting behavior difference for gawk and mawk, i wrote 3 different versions of the same awk script

That’s why I set up CI to ensure the same behavior across the different implementations. It seemed like it helped debugging here.

Regarding the comment, I’m pretty fine with them as long as there are test cases that cover that. Thank you for your contribution!

@chitoku-k chitoku-k merged commit 0a76141 into chitoku-k:master Oct 5, 2024
5 checks passed
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