feat(linters): add shellcheck_ebuild#904
Closed
ingenarel wants to merge 1 commit intomfussenegger:masterfrom
Closed
feat(linters): add shellcheck_ebuild#904ingenarel wants to merge 1 commit intomfussenegger:masterfrom
ingenarel wants to merge 1 commit intomfussenegger:masterfrom
Conversation
a custom setup for shellcheck that allows shellcheck to parse ebuilds without false SC2034 and SC2154 flags
bc6a4fd to
9b52c9e
Compare
Owner
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 |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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