Skip to content

Commit d85c315

Browse files
authored
forbid panics in linter (temporalio#7620)
## What changed? Forbid use of panics in new code ## Why? We had an incident because of a panic, so we want to only add panics if we are very sure panic-ing is the right thing to do. If people need to add a panic they can bypass the linter with a forbidigo comment as we do for time.Sleep ## How did you test it? I introduced a new panic and saw the linter catch it https://github.com/temporalio/temporal/actions/runs/14503587534 ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> ## Documentation <!-- Have you made sure this change doesn't falsify anything currently stated in `docs/`? If significant new behavior is added, have you described that in `docs/`? --> ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) -->
1 parent ce88340 commit d85c315

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ linters-settings:
4343
forbid:
4444
- p: time.Sleep
4545
msg: "Please use require.Eventually or assert.Eventually instead unless you've no other option"
46+
- p: panic
47+
msg: "Please avoid using panic in application code"
4648
importas:
4749
# Enforce the aliases below.
4850
no-unaliased: true

0 commit comments

Comments
 (0)