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

Upgrade shellcheck version #28021

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

gongweibao
Copy link
Contributor

@gongweibao gongweibao commented Oct 16, 2020

PR types

New features

PR changes

Others

Describe

Upgrade shellcheck version to v0.7.1 from 0.4.1 so users can get the warning wiki URL when they occured.

For example:
If we shellcheck this script,

#!/bin/sh
## Example: a typical script with several problems
for f in $(ls *.m3u)
do
  grep -qi hq.*mp3 $f \
    && echo -e 'Playlist $f contains a HQ file in mp3 format'
done

shellcheck will generate these:

In test.sh line 3:
for f in $(ls *.m3u)
         ^---------^ SC2045: Iterating over ls output is fragile. Use globs.
              ^-- SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options.


In test.sh line 5:
  grep -qi hq.*mp3 $f \
           ^-----^ SC2062: Quote the grep pattern so the shell won't interpret it.
                   ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean:
  grep -qi hq.*mp3 "$f" \


In test.sh line 6:
    && echo -e 'Playlist $f contains a HQ file in mp3 format'
            ^-- SC2039: In POSIX sh, echo flags are undefined.
               ^-- SC2016: Expressions don't expand in single quotes, use double quotes for that.

For more information:
  https://www.shellcheck.net/wiki/SC2045 -- Iterating over ls output is fragi...
  https://www.shellcheck.net/wiki/SC2039 -- In POSIX sh, echo flags are undef...
  https://www.shellcheck.net/wiki/SC2062 -- Quote the grep pattern so the she...

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@luotao1
Copy link
Contributor

luotao1 commented Oct 21, 2020

PR描述可以增强下

Upgrade shellcheck version to v0.7.1

原来是什么版本呢?

so users can get the warning wiki URL when they occured.

有没有示例显示?

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gongweibao gongweibao merged commit ee4309e into PaddlePaddle:develop Oct 22, 2020
@gongweibao gongweibao deleted the upgradshellcheck branch October 22, 2020 01:39
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

Successfully merging this pull request may close these issues.

2 participants