mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2104 (markdown)
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
### Problematic code:
|
### Problematic code:
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
foo() {
|
foo() {
|
||||||
if [[ -z $1 ]]
|
if [[ -z $1 ]]
|
||||||
then
|
then
|
||||||
@@ -14,7 +14,7 @@ foo() {
|
|||||||
|
|
||||||
### Correct code:
|
### Correct code:
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
foo() {
|
foo() {
|
||||||
if [[ -z $1 ]]
|
if [[ -z $1 ]]
|
||||||
then
|
then
|
||||||
@@ -31,7 +31,7 @@ foo() {
|
|||||||
|
|
||||||
The `break` or `continue` may be intended for a loop that calls the function:
|
The `break` or `continue` may be intended for a loop that calls the function:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# Rarely valid
|
# Rarely valid
|
||||||
foo() { break; echo $?; }
|
foo() { break; echo $?; }
|
||||||
while true; do foo; done
|
while true; do foo; done
|
||||||
|
Reference in New Issue
Block a user