Skip to content

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

@gkrimer gkrimer commented Sep 25, 2026 •

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
gkrimer marked this pull request as ready for review September 25, 2026 01:24
@gkrimer

gkrimer commented Sep 29, 2026 •

Copy link
Copy Markdown
Author

Alternatively, we can restrict the check to the as $var syntax that yq and jq have for variable declaration. This is a more substantial change but it would provide a more targeted check. This is very much Claude's work in progress: gkrimer#1

As I don't know Haskell I'd need to spend time gaining an understanding of these changes.

This branch has not been deployed

No deployments
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