Skip to content

Commit

Permalink
Add Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jkmassel committed Jun 29, 2022
1 parent 95b4b02 commit b82b318
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 43 deletions.
18 changes: 18 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,34 @@ common_params:
IMAGE_ID: xcode-13.4.1

steps:
#################
# Build and Test
#################
- label: "Build and Test"
key: test
command: |
build_and_test_pod
env: *common_env
plugins: *common_plugins
artifact_paths:
- "artifacts/**/*"

#################
# Validate Podspecs
#################
- label: "Validate Podspec"
key: validate
command: |
validate_podspec
env: *common_env
plugins: *common_plugins

#################
# Lint
#################
- label: "Lint"
key: lint
command: |
lint_pod
env: *common_env
plugins: *common_plugins
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AllCops:
NewCops: enable

Naming/FileName:
Exclude:
- Kanvas.podspec
18 changes: 10 additions & 8 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# frozen_string_literal: true

source 'https://cdn.cocoapods.org/'

use_modular_headers!
platform :ios, '13.0'

project "KanvasExample.xcodeproj"
project 'KanvasExample.xcodeproj'

target 'KanvasExample' do
pod 'Kanvas', :path => '../'
target 'KanvasExampleTests' do
inherit! :search_paths
use_frameworks!
pod 'iOSSnapshotTestCase', '8.0.0'
end
pod 'Kanvas', path: '../'

target 'KanvasExampleTests' do
inherit! :search_paths
use_frameworks!
pod 'iOSSnapshotTestCase', '8.0.0'
end
end
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ SPEC CHECKSUMS:
iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f
Kanvas: 27717d8f0003104bfdd3c4de37a82dc39c8ff09c

PODFILE CHECKSUM: c7d3758d9f258de551a3ddff1a65c7b8fab927aa
PODFILE CHECKSUM: fdc53cacfa7ab03ea306122ff8e788755ac41de3

COCOAPODS: 1.11.3
2 changes: 1 addition & 1 deletion Example/Pods/Manifest.lock

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

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'cocoapods', '1.11.3'
gem 'fastlane', '~> 2.206'
gem 'rubocop', '~> 1.31'
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ GEM
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.15)
ast (2.4.2)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.601.0)
Expand Down Expand Up @@ -219,17 +220,35 @@ GEM
netrc (0.11.0)
optparse (0.1.1)
os (1.1.4)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
plist (3.6.0)
public_suffix (4.0.7)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.5.0)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rouge (2.0.7)
rubocop (1.31.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
ruby-macho (2.5.1)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
Expand Down Expand Up @@ -279,6 +298,7 @@ PLATFORMS
DEPENDENCIES
cocoapods (= 1.11.3)
fastlane (~> 2.206)
rubocop (~> 1.31)

BUNDLED WITH
2.1.4
34 changes: 18 additions & 16 deletions Kanvas.podspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# frozen_string_literal: true

Pod::Spec.new do |spec|
spec.name = "Kanvas"
spec.version = "1.4.2"
spec.summary = "A custom camera built for iOS."
spec.homepage = "https://github.com/tumblr/kanvas-ios"
spec.license = "MPLv2"
spec.source = { :git => "https://github.com/tumblr/kanvas-ios.git",
:tag => "#{spec.version}" }
spec.authors = { "Jimmy Schementi" => "[email protected]",
"Tony Cheng" => "[email protected]" }
spec.platform = :ios, "13.0"
spec.swift_version = "4.2"
spec.name = 'Kanvas'
spec.version = '1.4.2'
spec.summary = 'A custom camera built for iOS.'
spec.homepage = 'https://github.com/tumblr/kanvas-ios'
spec.license = 'MPLv2'
spec.source = { git: 'https://github.com/tumblr/kanvas-ios.git',
tag: spec.version.to_s }
spec.authors = { 'Jimmy Schementi' => '[email protected]',
'Tony Cheng' => '[email protected]' }
spec.platform = :ios, '13.0'
spec.swift_version = '4.2'
spec.requires_arc = true
spec.frameworks = "Foundation", "GLKit", "OpenGLES", "UIKit"
spec.source_files = "Classes/**/*.{h,m,swift,vsh,glsl}"
spec.resource_bundles = { "Kanvas" => "Resources/*" }
spec.user_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "GLES_SILENCE_DEPRECATION=1" }
spec.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "GLES_SILENCE_DEPRECATION=1" }
spec.frameworks = 'Foundation', 'GLKit', 'OpenGLES', 'UIKit'
spec.source_files = 'Classes/**/*.{h,m,swift,vsh,glsl}'
spec.resource_bundles = { 'Kanvas' => 'Resources/*' }
spec.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GLES_SILENCE_DEPRECATION=1' }
spec.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GLES_SILENCE_DEPRECATION=1' }
end
39 changes: 22 additions & 17 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
# frozen_string_literal: true

default_platform(:ios)

PROJECT_ROOT = File.dirname(__dir__)
EXAMPLE_PROJECT_ROOT = File.join(PROJECT_ROOT, 'Example')
ARTIFACTS_PATH = File.join(PROJECT_ROOT, 'artifacts')

platform :ios do
desc "Build and Test the Pod"
desc 'Build and Test the Pod'
lane :test do
run_tests(
workspace: File.join(EXAMPLE_PROJECT_ROOT, 'KanvasExample.xcworkspace'),
scheme: 'KanvasExample',
devices: ['iPhone 8'],
deployment_target_version: '14.0'
)
end
end

# Create the artifacts path if needed
FileUtils.mkdir_p(ARTIFACTS_PATH)
error do |_lane, _exception|
# Create the artifacts path if needed
FileUtils.mkdir_p(ARTIFACTS_PATH)

begin
run_tests(
workspace: File.join(EXAMPLE_PROJECT_ROOT, 'KanvasExample.xcworkspace'),
scheme: 'KanvasExample',
devices: ['iPhone 8'],
deployment_target_version: '14.0'
)
ensure
zip(
path: File.join(EXAMPLE_PROJECT_ROOT, 'KanvasExampleTests', 'FailureDiffs'),
output_path: File.join(ARTIFACTS_PATH, 'FailureDiffs.zip')
)
end
end
diffs_path = File.join(EXAMPLE_PROJECT_ROOT, 'KanvasExampleTests', 'FailureDiffs')

return unless File.directory? diffs_path

zip(
path: diffs_path,
output_path: File.join(ARTIFACTS_PATH, 'FailureDiffs.zip')
)
end

0 comments on commit b82b318

Please sign in to comment.