Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Shellcheck Exclusions

Dylan Araps edited this page Dec 13, 2016 · 6 revisions

This wiki page lists all of the shellcheck errors that we're ignoring when testing Neofetch.

Can't follow non-constant source. Use a directive to specify location.

This error has been disabled since we're not sourcing the config file when running shellcheck.

SC2009 Consider using pgrep instead of grepping ps output.

We were originally using pgrep until we found out that pgrep has some issues on macOS systems.

Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames.

This only affects a single line in the macOS section of the get_packages() function. I can't fix this unless I get access to a macOS machine.

Use find instead of ls to better handle non-alphanumeric filenames.

This is OK to ignore since we're only counting the number of files and directories.

Expressions don't expand in single quotes, use double quotes for that.

This is intended, the expressions are sent to another shell. (zsh -c '${ZSH_VERSION}')

foo appears unused. Verify it or export it.

This error has been disabled since we dynamically use the info variables. ($kernel)

Expanding an array without an index only gives the first element.

Each info function in Neofetch is split into separate parts for each Operating System. One OS might need an array to get the info and the others may not. Shellcheck sees mixed usage of Arrays/Variables and that's what causes this error.

Possible Misspelling: MYVARIABLE may not be assigned, but MY_VARIABLE is.

We use a lot of Environment Variables and this error comes up whenever we reassign an Environment Variable to a local variable. Totally harmless.

var is referenced but not assigned.

This error has been disabled since the variables are in the config files which we don't source when testing with shellcheck.

Variable was used as an array but is now assigned a string.

Each info function in Neofetch is split into separate parts for each Operating System. One OS might need an array to get the info and the others may not. Shellcheck sees mixed usage of Arrays/Variables and that's what causes this error.