Skip to content

Commit 6b5e5dd

Browse files
committed
strict input to enable strict mode
1 parent 01d34ab commit 6b5e5dd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
description: 'SwiftLint version to use or "latest" to query the latest available version'
1212
required: false
1313
default: 'latest'
14+
strict:
15+
description: 'Upgrades warnings to serious violations (errors)'
16+
required: false
17+
default: 'false'
1418

1519
runs:
1620
using: node20

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ export async function run(): Promise<void> {
5353
// Run the SwiftLint binary and capture its standard output
5454
let stdout = ''
5555

56+
let swiftlintArgs = ['lint', '--reporter=json']
57+
if (core.getInput('strict') === 'true') {
58+
swiftlintArgs.push('--strict')
59+
}
5660
await exec.exec(
5761
path.join(portableSwiftlintDir, 'swiftlint'),
58-
['lint', '--reporter=json'],
62+
swiftlintArgs,
5963
{
6064
listeners: {
6165
stdout: (data: Buffer) => {

0 commit comments

Comments
 (0)