Skip to content

Instantly share code, notes, and snippets.

@maxfriedrich
Created August 10, 2017 13:32
Show Gist options
  • Save maxfriedrich/817c49c05c1f4d79ca53785f47a10a40 to your computer and use it in GitHub Desktop.
Save maxfriedrich/817c49c05c1f4d79ca53785f47a10a40 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
dir = File.dirname(File.realpath(__FILE__))
linter = File.join(dir, 'bin', 'swiftlint')
config = File.join(dir, 'config', 'swiftlint.yml')
output = `#{linter} lint --config #{config} 2>&1`
status = $?.exitstatus
STDERR.puts output
if (status == 1 && output.include?('No lintable files found'))
exit 0
else
exit status
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment