FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `yq` to list of commands ignored for SC2016 by gkrimer · Pull Request #3541 · koalaman/shellcheck · GitHub

Repository navigation

Add yq to list of commands ignored for SC2016 - #3541

Open
gkrimer wants to merge 1 commit into
koalaman:masterfrom
gkrimer:sc2016-ignore-yq
Open

gkrimer wants to merge 1 commit into
koalaman:masterfrom
gkrimer:sc2016-ignore-yq

Conversation

gkrimer commented Sep 25, 2026 •
edited
Loading

Copy link
Copy Markdown

Teach https://www.shellcheck.net/wiki/SC2016 about yq, which also has $var in expressions like jq:

yq '.metadata.name as $id | $id' deployment.yaml   # SC2016 today
jq '.metadata.name as $id | $id' deployment.json   # already allowed

This applies to both mikefarah/yq and kislyuk/yq (a jq wrapper). As with jq, the trade-off is missing '.x = "$VAR"' mistakes.

Written by Claude on behalf of @gkrimer.

gkrimer marked this pull request as ready for review September 25, 2026 01:24

gkrimer commented Sep 29, 2026 •
edited
Loading

Copy link
Copy Markdown
Author

Alternatively, we can restrict the check to the as $var syntax that yq and jq have for variable declaration. That is a more substantial change, but it would provide a more targeted check. Here is a very WIP prototype of what this might look like: gkrimer#1

Unfortunately gkrimer#1 was generated by Claude, and I don't really know Haskell so I'd need to spend quite a bit more time on it to understand and validate.

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL