Skip to content

Commit

Permalink
strict input to enable strict mode (#4)
Browse files Browse the repository at this point in the history
* `strict` input to enable strict mode

* bundle and lint

* bundle again
  • Loading branch information
fkorotkov authored May 15, 2024
1 parent 01d34ab commit bae7fee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: 'SwiftLint version to use or "latest" to query the latest available version'
required: false
default: 'latest'
strict:
description: 'Upgrades warnings to serious violations (errors)'
required: false
default: 'false'

runs:
using: node20
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ export async function run(): Promise<void> {
// Run the SwiftLint binary and capture its standard output
let stdout = ''

const swiftlintArgs = ['lint', '--reporter=json']
if (core.getInput('strict') === 'true') {
swiftlintArgs.push('--strict')
}
await exec.exec(
path.join(portableSwiftlintDir, 'swiftlint'),
['lint', '--reporter=json'],
swiftlintArgs,
{
listeners: {
stdout: (data: Buffer) => {
Expand Down

0 comments on commit bae7fee

Please sign in to comment.