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
84f62600
Commit
84f62600
authored
Aug 06, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Repo#lint] Improved support for the linter.
parent
09e5a60c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
linter.rb
lib/cocoapods/command/linter.rb
+5
-4
repo.rb
lib/cocoapods/command/repo.rb
+10
-5
No files found.
lib/cocoapods/command/linter.rb
View file @
84f62600
...
@@ -5,7 +5,7 @@ module Pod
...
@@ -5,7 +5,7 @@ module Pod
# TODO: Add check to ensure that attributes inherited by subspecs are not duplicated ?
# TODO: Add check to ensure that attributes inherited by subspecs are not duplicated ?
attr_accessor
:quick
,
:lenient
,
:no_clean
,
:
check_paths
attr_accessor
:quick
,
:lenient
,
:no_clean
,
:
repo_path
attr_reader
:spec
,
:file
attr_reader
:spec
,
:file
attr_reader
:errors
,
:warnings
,
:notes
attr_reader
:errors
,
:warnings
,
:notes
...
@@ -34,9 +34,10 @@ module Pod
...
@@ -34,9 +34,10 @@ module Pod
@spec
=
Specification
.
from_file
(
file
)
@spec
=
Specification
.
from_file
(
file
)
platforms
=
spec
.
available_platforms
platforms
=
spec
.
available_platforms
if
@check_paths
if
@repo_path
expected_path
=
"
#{
@spec
.
version
}
/
#{
@spec
.
name
}
.podspec"
expected_path
=
"
#{
@spec
.
name
}
/
#{
@spec
.
version
}
/
#{
@spec
.
name
}
.podspec"
@errors
<<
"Incorrect path, the path is `
#{
file
}
` and should be `
#{
expected_path
}
`"
unless
file
.
to_s
.
end_with?
(
expected_path
)
path
=
file
.
relative_path_from
(
@repo_path
).
to_s
@errors
<<
"Incorrect path, the path is `
#{
file
}
` and should be `
#{
expected_path
}
`"
unless
path
.
end_with?
(
expected_path
)
end
end
platforms
.
each
do
|
platform
|
platforms
.
each
do
|
platform
|
...
...
lib/cocoapods/command/repo.rb
View file @
84f62600
...
@@ -86,16 +86,16 @@ module Pod
...
@@ -86,16 +86,16 @@ module Pod
podspecs
.
each
do
|
podspec
|
podspecs
.
each
do
|
podspec
|
linter
=
Linter
.
new
(
podspec
)
linter
=
Linter
.
new
(
podspec
)
linter
.
lenient
=
true
linter
.
lenient
=
true
linter
.
quick
=
true
linter
.
quick
=
true
linter
.
check_paths
=
true
linter
.
repo_path
=
dir
linter
.
lint
linter
.
lint
unless
linter
.
result_type
==
:success
unless
linter
.
result_type
==
:success
invalid_count
+=
1
case
linter
.
result_type
case
linter
.
result_type
when
:error
when
:error
invalid_count
+=
1
color
=
:red
color
=
:red
when
:warning
when
:warning
color
=
:yellow
color
=
:yellow
...
@@ -108,7 +108,12 @@ module Pod
...
@@ -108,7 +108,12 @@ module Pod
end
end
end
end
puts
"Analyzed
#{
podspecs
.
count
}
podspecs files.
\n\n
"
unless
config
.
silent?
puts
"Analyzed
#{
podspecs
.
count
}
podspecs files.
\n\n
"
unless
config
.
silent?
invalid_count
if
invalid_count
==
0
puts
"All the specs passed validation."
.
green
<<
"
\n\n
"
unless
config
.
silent?
else
raise
Informative
,
"
#{
invalid_count
}
podspecs failed validation."
end
end
end
end
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