Skip to content

Commit bae7fee

Browse files
authored
strict input to enable strict mode (#4)
* `strict` input to enable strict mode * bundle and lint * bundle again
1 parent 01d34ab commit bae7fee

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
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

dist/index.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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+
const 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)