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
3028e378
Commit
3028e378
authored
Aug 06, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Linter] Added support to check the path of a podspec.
parent
b2961dd2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
linter.rb
lib/cocoapods/command/linter.rb
+14
-5
repo.rb
lib/cocoapods/command/repo.rb
+1
-0
No files found.
lib/cocoapods/command/linter.rb
View file @
3028e378
...
...
@@ -5,7 +5,7 @@ module Pod
# TODO: Add check to ensure that attributes inherited by subspecs are not duplicated ?
attr_accessor
:quick
,
:lenient
,
:no_clean
attr_accessor
:quick
,
:lenient
,
:no_clean
,
:check_paths
attr_reader
:spec
,
:file
attr_reader
:errors
,
:warnings
,
:notes
...
...
@@ -14,7 +14,9 @@ module Pod
end
def
spec_name
file
.
basename
(
'.*'
).
to_s
name
=
file
.
basename
(
'.*'
).
to_s
name
<<
(
@spec
?
" (
#{
spec
.
version
}
)"
:
" (
#{
file
.
dirname
.
basename
}
)"
)
name
end
# Takes an array of podspec files and lints them all
...
...
@@ -27,9 +29,16 @@ module Pod
if
!
deprecation_errors
.
empty?
@errors
=
deprecation_errors
@errors
<<
"
#{
platform
.
name
}
[!] Fatal errors found skipping the rest of the validation"
else
@spec
=
Specification
.
from_file
(
file
)
platforms
=
spec
.
available_platforms
if
@check_paths
expected_path
=
"
#{
@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
)
end
platforms
.
each
do
|
platform
|
@platform_errors
[
platform
],
@platform_warnings
[
platform
],
@platform_notes
[
platform
]
=
[],
[],
[]
...
...
@@ -48,9 +57,9 @@ module Pod
end
# Get common messages
@errors
=
@platform_errors
.
values
.
reduce
(
:&
)
@warnings
=
@platform_warnings
.
values
.
reduce
(
:&
)
@notes
=
@platform_notes
.
values
.
reduce
(
:&
)
@errors
+
=
@platform_errors
.
values
.
reduce
(
:&
)
@warnings
+
=
@platform_warnings
.
values
.
reduce
(
:&
)
@notes
+
=
@platform_notes
.
values
.
reduce
(
:&
)
platforms
.
each
do
|
platform
|
# Mark platform specific messages
...
...
lib/cocoapods/command/repo.rb
View file @
3028e378
...
...
@@ -88,6 +88,7 @@ module Pod
linter
=
Linter
.
new
(
podspec
)
linter
.
lenient
=
true
linter
.
quick
=
true
linter
.
check_paths
=
true
linter
.
lint
...
...
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