whitespaces normalization #72

Merged
benpro merged 2 commits from normalize-whitespaces into master 2019-03-22 10:01:53 +01:00
Owner
  • no tabs (4 spaces)
  • indentation for split lines
* no tabs (4 spaces) * indentation for split lines
benpro reviewed 2019-03-21 10:34:30 +01:00
@ -904,3 +902,2 @@
if [[ -n "$statResult" ]]; then
if [ -n "$statResult" ]; then
echo 'IS_OLD_HOME_DIR FAILED!'
if [[ "$VERBOSE" == 1 ]]; then
Contributor

In this case, this is pure appreciated bashism.
I like to use the double brackets because of "Using the ... test construct, rather than [ ... ] can prevent many logic errors in scripts. For example, the &&, ||, <, and > operators work within a test, despite giving an error within a [ ] construct."
https://www.tldp.org/LDP/abs/html/abs-guide.html#DBLBRACKETS

I use [[ ]] all the time. Except if the script has already a single bracket, I will not "recode" it with double brackets.

Good Practice:
Whenever you're making a Bash script, you should always use [[ rather than [.
https://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Blocks_.28if.2C_test_and_.5B.5B.29

In this case, this is pure appreciated bashism. I like to use the double brackets because of "Using the [[ ... ]] test construct, rather than [ ... ] can prevent many logic errors in scripts. For example, the &&, ||, <, and > operators work within a [[ ]] test, despite giving an error within a [ ] construct." https://www.tldp.org/LDP/abs/html/abs-guide.html#DBLBRACKETS I use `[[ ]]` all the time. Except if the script has already a single bracket, I will not "recode" it with double brackets. > Good Practice: > Whenever you're making a Bash script, you should always use [[ rather than [. https://mywiki.wooledge.org/BashGuide/TestsAndConditionals#Conditional_Blocks_.28if.2C_test_and_.5B.5B.29
Author
Owner

Right, these changes shouldn't have gone in this commit.
And I thought this script was not bash.
I'll remove those changes.

Right, these changes shouldn't have gone in this commit. And I thought this script was not bash. I'll remove those changes.
Contributor

That would be the contrary. Pure bash. We will not focus on POSIX things. (So you could use &> in evocheck.) ;)

The OpenBSD part should be pure sh, but is not production ready.
OpenBSD has already his branch so I guess we could already delete all things related to OpenBSD, and drop the if debian… But I will wait for @drustan.

That would be the contrary. Pure bash. We will not focus on POSIX things. (So you could use `&>` in evocheck.) ;) The OpenBSD part should be pure sh, but is not production ready. OpenBSD has already his branch so I guess we could already delete all things related to OpenBSD, and drop the `if debian`… But I will wait for @drustan.
@ -763,2 +761,3 @@
mysql_myisam_indexes mysql_qcache mysql_qcache_mem \
mysql_sorts mysql_tmp_tables; do
if [[ ! -L /etc/munin/plugins/$file ]]; then
Contributor

That's note a "whitespaces" normalization.

That's note a "whitespaces" normalization.
benpro added the
enhancement
label 2019-03-21 10:54:32 +01:00
Author
Owner

test changes have been reverted.

test changes have been reverted.
Contributor

LGTM. Still WIP?
There are many "not so clean" things to redo, whitespaces was one. Thanks.

LGTM. Still WIP? There are many "not so clean" things to redo, whitespaces was one. Thanks.
benpro approved these changes 2019-03-21 14:12:48 +01:00
Ghost approved these changes 2019-03-21 15:05:21 +01:00
Ghost left a comment
First-time contributor

Pas pire

Pas pire
First-time contributor

@jlecour I'm fairly certain shellcheck will emit warnings that are shell dependent. An idea would to add it to a pre-commit hook in git.

@jlecour I'm fairly certain shellcheck will emit warnings that are shell dependent. An idea would to add it to a pre-commit hook in git.
jlecour changed title from WIP: whitespaces normalization to whitespaces normalization 2019-03-21 17:09:15 +01:00
Author
Owner

I've removed the WIP tag. Let's merge this thing!

I've removed the WIP tag. Let's merge this thing!
Author
Owner

So, there are conflicts, I'll rebase first.

So, there are conflicts, I'll rebase first.
Author
Owner

Conflicts have been resolved. It can be merged

Conflicts have been resolved. It can be merged
benpro was assigned by jlecour 2019-03-21 21:22:23 +01:00
jlecour closed this pull request 2019-03-21 21:22:37 +01:00
jlecour reopened this pull request 2019-03-21 21:22:42 +01:00
benpro closed this pull request 2019-03-22 10:01:53 +01:00
benpro deleted branch normalize-whitespaces 2019-03-22 10:02:07 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evocheck#72
No description provided.