soumya92/barista

View on GitHub

Showing 107 of 107 total issues

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

[ -e "$CONFIG_DIR/barista/keys" ] && . "$CONFIG_DIR/barista/keys"
Severity: Minor
Found in build.sh by shellcheck

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.

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2020 Google Inc.
Severity: Minor
Found in timing/timerfd_scheduler_fallback.go by gofmt

var childId should be childID
Open

        oldName, childId := nameAndId(child)
Severity: Minor
Found in logging/id.go by golint

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2017 Google Inc.
Severity: Minor
Found in modules/meta/reformat/reformat.go by gofmt

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2017 Google Inc.
Severity: Minor
Found in pango/icons/icons.go by gofmt

func nameAndId should be nameAndID
Open

func nameAndId(thing interface{}) (name string, id ident) {
Severity: Minor
Found in logging/id.go by golint

Inline HTML
Open

<img src="https://raw.githubusercontent.com/soumya92/barista/gh-pages/logo/128.png" height="128" width="128" alt="Logo" />
Severity: Info
Found in README.md by markdownlint

MD033 - Inline HTML

Tags: html

Aliases: no-inline-html

This rule is triggered whenever raw HTML is used in a markdown document:

Inline HTML header

To fix this, use 'pure' markdown instead of including raw HTML:

# Markdown header

Rationale: Raw HTML is allowed in markdown, but this rule is included for those who want their documents to only include "pure" markdown, or for those who are rendering markdown documents in something other than HTML.

var thingId should be thingID
Open

    thingName, thingId := nameAndId(thing)
Severity: Minor
Found in logging/id.go by golint

Double quote array expansions to avoid re-splitting elements.
Open

for KEY in ${KEYS[@]}; do
Severity: Minor
Found in build.sh by shellcheck

Double quote array expansions to avoid re-splitting elements.

Problematic code:

cp $@ ~/dir

Correct code:

cp "$@" ~/dir

Rationale:

Double quotes around $@ (and similarly, ${array[@]}) prevents globbing and word splitting of individual elements, while still expanding to multiple separate arguments.

Let's say you have three arguments: baz, foo bar and *

"$@" will expand into exactly that: baz, foo bar and *

$@ will expand into multiple other arguments: baz, foo, bar, file.txt and otherfile.jpg

Since the latter is rarely expected or desired, ShellCheck warns about it.

Exceptions

When you want globbing of individual elements.

Notice

Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2017 Google Inc.
Severity: Minor
Found in samples/sample-bar/cachehttp.go by gofmt

This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
Open

        -coverprofile=profiles/$(echo "PKG" | sed -e "s|./||" -e "s|/|_|g").out \
Severity: Minor
Found in test.sh by shellcheck

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.

This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
Open

    go test \
Severity: Minor
Found in test.sh by shellcheck

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.

This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
Open

        -covermode=atomic \
Severity: Minor
Found in test.sh by shellcheck

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.

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2017 Google Inc.
Severity: Minor
Found in testing/httpcache/httpcache.go by gofmt

var childId should be childID
Open

    childName, childId := nameAndId(child)
Severity: Minor
Found in logging/id.go by golint

This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
Open

        -timeout 90s \
Severity: Minor
Found in test.sh by shellcheck

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.

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2020 Google Inc.
Severity: Minor
Found in timing/timerfd_scheduler.go by gofmt

Line length
Open

<img src="https://raw.githubusercontent.com/soumya92/barista/gh-pages/logo/128.png" height="128" width="128" alt="Logo" />
Severity: Info
Found in README.md by markdownlint

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.

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2017 Google Inc.
Severity: Minor
Found in outputs/outputs.go by gofmt

Your code does not pass gofmt in 1 place. Go fmt your code!
Open

// Copyright 2018 Google Inc.
Severity: Minor
Found in testing/output/output.go by gofmt
Severity
Category
Status
Source
Language