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
0360ab89
Commit
0360ab89
authored
Sep 19, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Linter] Promote long summary warning to an error.
parent
90174caa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
linter.rb
lib/cocoapods/command/linter.rb
+2
-3
dependency.rb
lib/cocoapods/dependency.rb
+2
-2
repo_spec.rb
spec/functional/command/repo_spec.rb
+1
-2
temporary_repos.rb
spec/spec_helper/temporary_repos.rb
+1
-1
No files found.
lib/cocoapods/command/linter.rb
View file @
0360ab89
...
...
@@ -166,10 +166,11 @@ module Pod
messages
<<
"Unrecognized platfrom"
unless
platform_valid?
messages
<<
"Missing name"
unless
spec
.
name
messages
<<
"Missing version"
unless
spec
.
version
messages
<<
"Missing summary"
unless
spec
.
summary
messages
<<
"Missing summary"
unless
spec
.
summary
||
spec
.
summary
.
empty?
messages
<<
"Missing homepage"
unless
spec
.
homepage
messages
<<
"Missing author(s)"
unless
spec
.
authors
messages
<<
"Missing or invalid source:
#{
spec
.
source
}
"
unless
source_valid?
messages
<<
"The summary should be short use `description` (max 140 characters)."
if
spec
.
summary
&&
spec
.
summary
.
length
>
140
# attributes with multiplatform values
return
messages
unless
platform_valid?
...
...
@@ -223,13 +224,11 @@ module Pod
messages
<<
"Missing license type"
unless
license
[
:type
]
messages
<<
"Sample license type"
if
license
[
:type
]
&&
license
[
:type
]
=~
/\(example\)/
messages
<<
"Invalid license type"
if
license
[
:type
]
&&
license
[
:type
]
=~
/\n/
messages
<<
"The summary is required"
if
spec
.
summary
.
empty?
messages
<<
"The summary is not meaningful"
if
spec
.
summary
=~
/A short description of/
messages
<<
"The description is not meaningful"
if
spec
.
description
&&
spec
.
description
=~
/An optional longer description of/
messages
<<
"The summary should end with a dot"
if
spec
.
summary
!~
/.*\./
messages
<<
"The description should end with a dot"
if
spec
.
description
!~
/.*\./
&&
spec
.
description
!=
spec
.
summary
messages
<<
"The summary should end with a dot"
if
spec
.
summary
!~
/.*\./
messages
<<
"The summary should be short use `description` (max 140 characters)."
if
spec
.
summary
.
length
>
140
messages
<<
"Comments must be deleted"
if
text
.
scan
(
/^\s*#/
).
length
>
24
messages
<<
"Warnings must not be disabled (`-Wno' compiler flags)"
if
spec
.
compiler_flags
.
split
(
' '
).
any?
{
|
flag
|
flag
.
start_with?
(
'-Wno'
)
}
...
...
lib/cocoapods/dependency.rb
View file @
0360ab89
...
...
@@ -177,10 +177,10 @@ module Pod
output_path
=
sandbox
.
root
+
"Local Podspecs/
#{
name
}
.podspec"
output_path
.
dirname
.
mkpath
if
podspec
.
is_a?
(
String
)
raise
Informative
,
"No podspec found for `
#{
name
}
' in
`
#{
description
}
'
"
unless
podspec
.
include?
(
'Spec.new'
)
raise
Informative
,
"No podspec found for `
#{
name
}
' in
#{
description
}
"
unless
podspec
.
include?
(
'Spec.new'
)
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
)
}
else
raise
Informative
,
"No podspec found for `
#{
name
}
' in
`
#{
description
}
'
"
unless
podspec
.
exist?
raise
Informative
,
"No podspec found for `
#{
name
}
' in
#{
description
}
"
unless
podspec
.
exist?
FileUtils
.
copy
(
podspec
,
output_path
)
end
end
...
...
spec/functional/command/repo_spec.rb
View file @
0360ab89
...
...
@@ -7,7 +7,6 @@ describe "Pod::Command::Repo" do
extend
SpecHelper
::
TemporaryRepos
it
"runs with correct parameters"
do
lambda
{
run_command
(
'repo'
,
'add'
,
'NAME'
,
'URL'
)
}.
should
.
not
.
raise
lambda
{
run_command
(
'repo'
,
'update'
)
}.
should
.
not
.
raise
lambda
{
run_command
(
'repo'
,
'lint'
,
temporary_directory
.
to_s
)
}.
should
.
not
.
raise
end
...
...
@@ -18,7 +17,7 @@ describe "Pod::Command::Repo" do
end
it
"adds a spec-repo"
do
add_repo
(
'private'
,
fixture
(
'spec-repos/master'
))
run_command
(
'repo'
,
'add'
,
'private'
,
fixture
(
'spec-repos/master'
))
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'spec-repos/master'
).
to_s
end
...
...
spec/spec_helper/temporary_repos.rb
View file @
0360ab89
...
...
@@ -32,7 +32,7 @@ module SpecHelper
command
.
run
Dir
.
chdir
(
command
.
dir
)
do
`git checkout -b test >/dev/null 2>&1`
`git branch --set-upstream test origin/
test
>/dev/null 2>&1`
`git branch --set-upstream test origin/
master
>/dev/null 2>&1`
end
command
end
...
...
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