Skip to content
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

Document Error Codes like Shellcheck #9

Open
jordantrizz opened this issue May 18, 2023 · 0 comments
Open

Document Error Codes like Shellcheck #9

jordantrizz opened this issue May 18, 2023 · 0 comments

Comments

@jordantrizz
Copy link

This was proposed on Reddit.

https://www.reddit.com/r/zsh/comments/10nb0y0/announcing_zshscan_a_zshlinter_zsh/

I like how shellcheck assigns each type of error or warning with a code, that optimistically corresponds to a page on their wiki to read more about it.

So for example with zsh-sweep, it tells me:

Notice: running check: CHECK_ZERO_ASSIGNMENT…
[ZSweep][zscan:125]: Warning: $0 assignment is missing, it should be:
·0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}
Notice: running check: CHECK_ZERO_ASSIGNMENT_STD…
[ZSweep][zscan:125]: Warning: $0 setting isn't the standard one, it's best if it's:
·0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}

It would be great if the project had wiki pages or readme sections or something corresponding to CHECK_ZERO_ASSIGNMENT and CHECK_ZERO_ASSIGNMENT_STD, where a user can learn more about the what and why of those warnings and suggested solutions.

Then there are a bunch of lines like:

[ZSweep][zsfilt:184]: Error: near line #2399 ↔  words=(pip-compile $words):
but it doesn't identify the error by a code or name or description, so I can't tell what's wrong.

EDIT:

Then there are some warnings like:

[ZSweep][zscan:125]: Warning: Incorrect array append, it should say: arr+=(elem) not: arr+=elem which doesn't work on various occasions.

and

[ZSweep][zscan:125]: Warning: A global variable has been created without declaration, by assignment. Add a line like local VAR or typeset -g VAR so that the variable is defined before use.

but they don't seem to indicate where in my source these issues are encountered.

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

No branches or pull requests

1 participant