Skip to content

Commit

Permalink
enable/disable lint tasks automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Mar 1, 2017
1 parent 44321e8 commit 5b9abd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ WORKSPACE = 'StencilSwiftKit'
TARGET_NAME = 'Tests'
CONFIGURATION = 'Debug'
POD_NAME = 'StencilSwiftKit'
TEST_PATH = "Tests/#{POD_NAME}Tests"


task :default => 'xcode:test'
20 changes: 15 additions & 5 deletions rakelib/lint.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@ namespace :lint do
end
end

desc 'Lint the code'
task :code => :install do |task|
Utils.print_info 'Linting the code'
Utils.run(%Q(swiftlint lint --no-cache --strict --path Sources), task)
if File.directory?('Sources')
desc 'Lint the code'
task :code => :install do |task|
Utils.print_info 'Linting the code'
Utils.run(%Q(swiftlint lint --no-cache --strict --path Sources), task)
end
end

desc 'Lint the tests'
task :tests => :install do |task|
Utils.print_info 'Linting the unit test code'
Utils.run(%Q(swiftlint lint --no-cache --strict --path "#{TEST_PATH}"), task)
Utils.run(%Q(swiftlint lint --no-cache --strict --path "Tests/#{WORKSPACE}Tests"), task)
end

if File.directory?('Tests/Expected')
desc 'Lint the output'
task :output => :install do |task|
Utils.print_info 'Linting the template output code'
Utils.run(%Q(swiftlint lint --no-cache --strict --path Tests/Expected), task)
end
end
end

0 comments on commit 5b9abd1

Please sign in to comment.