-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Request: Support PKGBUILD files #1843
Comments
There's an app for that: https://github.com/vn971/rua |
@gromgit Thanks for your suggestion. However, I do not intend to use shellcheck or rua in the terminal, but rather, as a linter for VS Code. |
@gromgit Actually, one |
If I read the vscode-shellcheck docs correctly, you really want to set up a separate workspace for PKGBUILD development, and configure the following options therein:
Of course, that would hide any real SC2034/2154 problems in your PKGBUILD. Ideally, you'd want something that transforms your PKGBUILD source into something that Shellcheck can check as a proper shell script, then somehow map the results back to your original source. I've raised an issue for this: see #1844. |
Just let shellcheck disable SC2148/2034 for https://github.com/koalaman/shellcheck/wiki/Ignore#ignoring-all-errors-in-a-file-08 Before: After: Update: Add this line to your # shellcheck shell=bash disable=SC2034 |
Can any PR about it (let PKGBUILD be recognized as bash) be accpeted? |
There's a very similar situation with However, I would globally ignore |
I think it would be useful is variables could be ignored by name (rather than putting the directive on the line above where they are declared). |
Create
However, Why it cannot support configuration for different filenames like editorconfig? Such as: [{PKGBUILD,build.sh,*.{install,ebuild,subpackage.sh}}]
shell=bash
disable=SC2034,SC2154 It will disable SC2034,SC2154 for Archlinux's Or just use editorconfig format. See #2128 |
Shellcheck will traverse the folder structure backwards to find the shellcheckrc file. Using that knowledge you could choose to place the
|
I hope it can become a global settings, that is, when this file name is |
Sad that there's still no support for PKGBUILDs. Ignoring all warnings isn't really helpful either, as they could be valid. ShellCheck would just need to know that some variables are used outside the context and some are supplied. Isn't really THAT big of a deal in being implemented. |
If it's not that big of a deal, then someone interested on it should send a pull request to implement the feature. |
@austin987 why? Learning an obscure language just for the sake of a PR makes no sense. |
Because it's a FOSS project? If you want something done, either be patient, do it yourself, or pay someone to do the work. You can't demand that someone prioritize your particular issue (I mean, you can, but don't expect it to work). |
Return to this question. I think the problem is more complex. |
I've never demanded anything. I said it's "sad" that it's still not working. |
I rethink #1843 (comment). We can refer typescript's For example, when we edit A magic comment can be If bash-language-server support type annotation, |
@Freed-Wu Adding magic comments would be less than ideal in my opinion when you are contributing to a file maintained by someone who isn't using bash-ls. |
Arch Linux's PKGBUILD is a shell script with a few differences:
makepkg
but are marked as unused (SC2034) byshellcheck
$srcdir
) are provided bymakepkg
but are marked SC2164 byshellcheck
Example PKGBUILD
The text was updated successfully, but these errors were encountered: