Showing 92 of 92 total issues
Line length Open
<img src="https://raw.githubusercontent.com/soumya92/barista/gh-pages/logo/128.png" height="128" width="128" alt="Logo" />
- Read upRead up
- Exclude checks
MD013 - Line length
Tags: line_length
Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)
This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.
This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.
You also have the option to exclude this rule for code blocks and tables. To
do this, set the code_blocks
and/or tables
parameters to false.
Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.
Can't follow non-constant source. Use a directive to specify location. Open
[ -e "$CONFIG_DIR/barista/keys" ] && . "$CONFIG_DIR/barista/keys"
- Read upRead up
- Exclude checks
Can't follow non-constant source. Use a directive to specify location.
Problematic code:
. "$(find_install_dir)/lib.sh"
Correct code:
# shellcheck source=src/lib.sh
. "$(find_install_dir)/lib.sh"
Rationale:
ShellCheck is not able to include sourced files from paths that are determined at runtime. The file will not be read, potentially resulting in warnings about unassigned variables and similar.
Use a [[Directive]] to point shellcheck to a fixed location it can read instead.
Exceptions:
If you don't care that ShellCheck is unable to account for the file, specify # shellcheck source=/dev/null
.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
var childId should be childID Open
oldName, childId := nameAndId(child)
- Exclude checks
First header should be a top level header Open
## Contributor License Agreement
- Read upRead up
- Exclude checks
MD002 - First header should be a top level header
Tags: headers
Aliases: first-header-h1
Parameters: level (number; default 1)
This rule is triggered when the first header in the document isn't a h1 header:
## This isn't a H1 header
### Another header
The first header in the document should be a h1 header:
# Start with a H1 header
## Then use a H2 for subsections
Emphasis used instead of a header Open
**This is not an official Google product**
- Read upRead up
- Exclude checks
MD036 - Emphasis used instead of a header
Tags: headers, emphasis
Parameters: punctuation (string; default ".,;:!?")
Aliases: no-emphasis-as-header
This check looks for instances where emphasized (i.e. bold or italic) text is used to separate sections, where a header should be used instead:
**My document**
Lorem ipsum dolor sit amet...
_Another section_
Consectetur adipiscing elit, sed do eiusmod.
To fix this, use markdown headers instead of emphasized text to denote sections:
# My document
Lorem ipsum dolor sit amet...
## Another section
Consectetur adipiscing elit, sed do eiusmod.
Note: this rule looks for single line paragraphs that consist entirely of emphasized text. It won't fire on emphasis used within regular text, multi-line emphasized paragraphs, and paragraphs ending in punctuation. Similarly to rule MD026, you can configure what characters are recognized as punctuation.
This backslash+linefeed is literal. Break outside single quotes if you just want to break the line. Open
-timeout 90s \
- Read upRead up
- Exclude checks
This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
Problematic code:
var='This is long \
piece of text'
Correct code:
var='This is a long '\
'piece of text'
Rationale:
You have a single quoted string containing a backslash followed by a linefeed (newline). Unlike double quotes or unquoted strings, this has no special meaning. The string will contain a literal backslash and a linefeed.
If you wanted to break the line but not add a linefeed to the string, stop the single quote, break the line, and reopen it. This is demonstrated in the correct code.
If you wanted to break the line and also include the linefeed as a literal, you don't need a backslash:
var='This is a multi-line string
with an embedded linefeed'
Exceptions:
If you do want a string containing a literal backslash+linefeed combo, such as with sed
, you can [[ignore]] this warning.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
TODO found Open
// TODO: See if this is a solved problem.
- Exclude checks
TODO found Open
// TODO: Handle parent being moved. For most modules, this is not
- Exclude checks
TODO found Open
// TODO: Figure out how to check the token for server-side validity.
- Exclude checks
TODO found Open
// TODO: Handle more than 10 arguments.
- Exclude checks
TODO found Open
# TODO: Use argument parsing here.
- Exclude checks
TODO found Open
// TODO: Argument parsing here.
- Exclude checks