-
Notifications
You must be signed in to change notification settings - Fork 125
Add clean if-file-deleted setting #90
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
95da156
5f5c3e2
916e34e
bcaa9cb
aa27ee3
a44e755
0ea477e
50042eb
46ba335
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,8 +234,18 @@ export class Analyzer { | |
| } | ||
| } | ||
|
|
||
| if (wireitConfig?.clean !== undefined) { | ||
| assertBoolean(placeholder, wireitConfig.clean, 'clean'); | ||
| if ( | ||
| wireitConfig?.clean !== undefined && | ||
| wireitConfig.clean !== true && | ||
| wireitConfig.clean !== false && | ||
| wireitConfig.clean !== 'if-file-deleted' | ||
|
Comment on lines
+239
to
+241
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if actionable, wondering if this should all be the same type? All strings instead of a bool and string combo.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Those seem semantically equivalent to |
||
| ) { | ||
| throw new WireitError({ | ||
| script: placeholder, | ||
| type: 'failure', | ||
| reason: 'invalid-config-syntax', | ||
| message: `clean must be true, false, or "if-file-deleted"`, | ||
| }); | ||
| } | ||
|
|
||
| if (wireitConfig?.packageLocks !== undefined) { | ||
|
|
@@ -426,24 +436,6 @@ const assertString = ( | |
| } | ||
| }; | ||
|
|
||
| /** | ||
| * Throw an error if the given value is not a boolean. | ||
| */ | ||
| const assertBoolean = ( | ||
| script: ScriptReference, | ||
| value: unknown, | ||
| name: string | ||
| ) => { | ||
| if (typeof value !== 'boolean') { | ||
| throw new WireitError({ | ||
| type: 'failure', | ||
| reason: 'invalid-config-syntax', | ||
| script, | ||
| message: `${name} is not a boolean`, | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| /** | ||
| * Throw an error if the given value is not an Array. | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.