Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
b6143c3e
Commit
b6143c3e
authored
Oct 02, 2016
by
Danielle Tomlinson
Committed by
GitHub
Oct 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5989 from CocoaPods/dani_swift_version_flag
Allow passing --swift-version to pod spec/lib lint
parents
7eb9ef04
bd4bff32
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
lint.rb
lib/cocoapods/command/lib/lint.rb
+4
-0
lint.rb
lib/cocoapods/command/spec/lint.rb
+4
-0
validator.rb
lib/cocoapods/validator.rb
+4
-0
validator_spec.rb
spec/unit/validator_spec.rb
+7
-0
No files found.
CHANGELOG.md
View file @
b6143c3e
...
...
@@ -36,6 +36,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Danielle Tomlinson
](
https://github.com/dantoml
)
[
#5984
](
https://github.com/CocoaPods/CocoaPods/pull/5984
)
*
Allow setting the linting Swift version via
`--swift-version=VERSION`
[
Danielle Tomlinson
](
https://github.com/dantoml
)
[
#5989
](
https://github.com/CocoaPods/CocoaPods/pull/5989
)
##### Bug Fixes
*
Remove special handling for messages apps
...
...
lib/cocoapods/command/lib/lint.rb
View file @
b6143c3e
...
...
@@ -21,6 +21,8 @@ module Pod
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
],
[
'--private'
,
'Lint skips checks that apply only to public specs'
],
[
'--swift-version=VERSION'
,
'The SWIFT_VERSION that should be used to lint the spec. '
\
'This takes precedence over a .swift-version file.'
],
].
concat
(
super
)
end
...
...
@@ -34,6 +36,7 @@ module Pod
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@private
=
argv
.
flag?
(
'private'
,
false
)
@swift_version
=
argv
.
option
(
'swift-version'
,
nil
)
@podspecs_paths
=
argv
.
arguments!
super
end
...
...
@@ -55,6 +58,7 @@ module Pod
validator
.
only_subspec
=
@only_subspec
validator
.
use_frameworks
=
@use_frameworks
validator
.
ignore_public_only_results
=
@private
validator
.
swift_version
=
@swift_version
validator
.
validate
unless
@clean
...
...
lib/cocoapods/command/spec/lint.rb
View file @
b6143c3e
...
...
@@ -27,6 +27,8 @@ module Pod
'(defaults to https://github.com/CocoaPods/Specs.git). '
\
'Multiple sources must be comma-delimited.'
],
[
'--private'
,
'Lint skips checks that apply only to public specs'
],
[
'--swift-version=VERSION'
,
'The SWIFT_VERSION that should be used to lint the spec. '
\
'This takes precedence over a .swift-version file.'
],
].
concat
(
super
)
end
...
...
@@ -40,6 +42,7 @@ module Pod
@use_frameworks
=
!
argv
.
flag?
(
'use-libraries'
)
@source_urls
=
argv
.
option
(
'sources'
,
'https://github.com/CocoaPods/Specs.git'
).
split
(
','
)
@private
=
argv
.
flag?
(
'private'
,
false
)
@swift_version
=
argv
.
option
(
'swift-version'
,
nil
)
@podspecs_paths
=
argv
.
arguments!
super
end
...
...
@@ -57,6 +60,7 @@ module Pod
validator
.
only_subspec
=
@only_subspec
validator
.
use_frameworks
=
@use_frameworks
validator
.
ignore_public_only_results
=
@private
validator
.
swift_version
=
@swift_version
validator
.
validate
failure_reasons
<<
validator
.
failure_reason
...
...
lib/cocoapods/validator.rb
View file @
b6143c3e
...
...
@@ -251,6 +251,10 @@ module Pod
@swift_version
||=
dot_swift_version
||
'2.3'
end
# Set the SWIFT_VERSION that should be used to validate the pod.
#
attr_writer
:swift_version
# @return [String] the SWIFT_VERSION in the .swift-version file or nil.
#
def
dot_swift_version
...
...
spec/unit/validator_spec.rb
View file @
b6143c3e
...
...
@@ -834,6 +834,13 @@ module Pod
validator
.
swift_version
.
should
==
'2.3'
end
it
'allows the user to set the version'
do
validator
=
test_swiftpod
validator
.
stubs
(
:dot_swift_version
).
returns
(
'3.0'
)
validator
.
swift_version
=
'4.0'
validator
.
swift_version
.
should
==
'4.0'
end
it
'checks for dot_swift_version'
do
validator
=
test_swiftpod
validator
.
expects
(
:dot_swift_version
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment