Skip to content

feat(linters): add shellcheck_ebuild#904

Closed
ingenarel wants to merge 1 commit intomfussenegger:masterfrom
ingenarel:shellcheck_ebuild
Closed

feat(linters): add shellcheck_ebuild#904
ingenarel wants to merge 1 commit intomfussenegger:masterfrom
ingenarel:shellcheck_ebuild

Conversation

@ingenarel
Copy link
Copy Markdown

disclaimer: if this is not in the scope of this plugin, please tell me and i'll make a seperate plugin that adds this config for nvim-lint

shellcheck throws a lot of false SC2034 and SC2154 warnings for ebuilds, there has been an open issue for allowing pre declared external globals since 2015: httpcreate.shs://github.com/koalaman/shellcheck/issues/356 and a discussion about a fork which is also possibly now defunct: koalaman/shellcheck#2704

i have found a workaround for ebuilds and i was able to implement it's usage for neovim

in short: the small create.sh script generates a lua file that returns a string of all the ebuild and eclass vars exported, then the linter config creates a new .ebuild file in the cache with that's the original ebuild file, and the export data appended to them, because they're just exports shellcheck doesn't throw a warning on them, and on top of that it also stops false positives

i'll keep this as a draft for now because i still have a few other niche variables to add

a custom setup for shellcheck that allows shellcheck to parse ebuilds
without false SC2034 and SC2154 flags
@mfussenegger
Copy link
Copy Markdown
Owner

if this is not in the scope of this plugin, please tell me and i'll make a seperate plugin that adds this config for nvim-lint

This does indeed look a bit more than what's typically in scope for a linter definition. What would be okay is if you create a shellcheck_ebuild project that has it's own executable wrapping shellcheck with the logic here and then update this PR with a shellcheck_ebuild linter that calls that shellcheck_ebuild executable without any extra scripts needed in nvim-lint.

@ingenarel ingenarel closed this Feb 19, 2026
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