Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: CURL detection, and shellcheck corrections#242

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hucste wants to merge18 commits intomitchellkrogza:master
base:master
Choose a base branch
Loading
fromhucste:master

Conversation

@hucste
Copy link

Hi....

Here are several corrections, by shellcheck.net and especially for CURL detection and using!

;)

@itoffshore
Copy link
Collaborator

itoffshore commentedJan 3, 2019
edited
Loading

I'm rejecting some of the commits in thisPR mainly for:

Continuing:

  • the helper scripts are compatible withBASH /ASH /DASH /MKSH shells & make extensive use of functions withlocal variables. POSIX may soon definelocal:

https://stackoverflow.com/questions/18597697/posix-compliant-way-to-scope-variables-to-a-function-in-a-shell-script

http://austingroupbugs.net/view.php?id=767

The only shell which does not supportlocal isKSH which definestypeset but this is not POSIX compliant either.

  • Initialising variables withvar= isnot an error

  • Quoting variables unnecessarily gives them the same colour as strings innano. Again I prefer readability.

  • $* versus$@ : The implementation of$* has always been a problem and realistically should have been replaced with the behaviour of$@. In almost every case where coders use$*, they mean$@.$* Can cause bugs and even security holes in your software.

  • get_options $@ -$@ is quoted inside the function itself

  • replacingcurl with a path in$CURL will hide system configuration errors (curl not being in$PATH).

  • runningcat on a file with multiple lines is not useless

  • awk instead ofgrep - this is less readable

  • adding$IS_CRON is not really needed.update-ngxblocker already has a-q option for quiet non-ANSI output designed for when run fromcron.


Commits which are OK:

  • fix: shellcheck SC2059, use printf '..%s..' ""

  • fix: shellcheck SC2230, use 'command -v' instead of 'wich' =>please fix the mispelling of which

  • fix: shellcheck SC2062, quote the grep pattern


Other comments:

some of your commits had alignment issues (tabs versus spaces) - before making a local commit you should always rungit diff to check for alignment issues.

thisPR has been made on yourmaster branch. It is good practice to always create a repobranch for aPR to prevent issues merging the changes back into yourmaster

@hucste
Copy link
Author

Just few comment:

  • ksh supports local. it's an alias on typeset! (see:http://man.openbsd.org/ksh#Aliases )
  • about 'awk', I do not agree at all ... but I would not argue more than that: it seems to me preferable to use a single tool, rather than 36, especially if the action remains understandable... simple to understand, simple to execute.
  • ok, about your option -q ;)

I will create a new PR, in some days, with you notes.

@hucste
Copy link
Author

hucste commentedJan 13, 2019
edited
Loading

Hi,

Is this previous fixd5ff386 about the management ot the printf messages, is ok, for you?!

Can i recreate it again on a new branch?

@itoffshore
Copy link
Collaborator

@hucste - I am happy to merge:


Commits which are OK:

  • fix: shellcheck SC2230, use 'command -v' instead of 'wich' =>please fix the spelling of which

  • fix: shellcheck SC2062, quote the grep pattern

  • fix: shellcheck SC2059, use printf '..%s..' "" =>please remove the following change

@@ -240,7 +240,7 @@ print_message() {msg="$@"if [ "$VERBOSE" != "N" ]; thenprintf "$msg"printf '%s\n' "$msg"fi}

I think it is clearer for new line formatting to be whereprint_message() is called from.


  • As you have made thePR on yourmaster branch I think the easy way to fix this is to do ahard reset of your fork:
git checkout mastergit remote updategit reset --hard upstream/master --git push origin +master
  • & create abranch to work on for the newPR

git checkout -b my-branch

  • & add the 3 commits above to the newPR.

@mmoya
Copy link

mmoya commentedNov 17, 2022
edited by unfurl-linksbot
Loading

POSIX may soon definelocal:

http://austingroupbugs.net/view.php?id=767

FTR, the proposal was rejected on 2022-08-08.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@hucste@itoffshore@mmoya

[8]ページ先頭

©2009-2025 Movatter.jp