mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2317 (markdown)
@@ -39,7 +39,7 @@ ShellCheck may incorrectly believe that code is unreachable if it's invoked by v
|
||||
|
||||
Note in particular that since unreachable commands may come in clusters, it's useful to use ShellCheck's filewide or functionwide ignore directives. A `disable` directive before a function ignores the entire function:
|
||||
|
||||
```
|
||||
```sh
|
||||
#!/bin/bash
|
||||
...
|
||||
# shellcheck disable=SC2317 # Don't warn about unreachable commands in this function
|
||||
@@ -52,7 +52,7 @@ exit 0
|
||||
```
|
||||
|
||||
A disable directive after the shebang, before any commands, will ignore the entire file:
|
||||
```
|
||||
```sh
|
||||
#!/bin/bash
|
||||
# Test script #1
|
||||
# shellcheck disable=SC2317 # Don't warn about unreachable commands in this file
|
||||
|
Reference in New Issue
Block a user