-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix spm licenses gen #150
Fix spm licenses gen #150
Conversation
Thank you, I'll check tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you handle this error?
And, swiftlint
warnings exist. Could you fix that?
swiftlint result
Loading configuration from '.swiftlint.yml'
Linting Swift files at paths
Linting 'main.swift' (1/55)
Linting 'Consts.swift' (2/55)
Linting 'SearchRequests.swift' (3/55)
Linting 'RepoRequests.swift' (4/55)
Linting 'Extensions.swift' (5/55)
Linting 'GitHubRequest.swift' (6/55)
Linting 'String.extension.swift' (7/55)
Linting 'CocoaPodsLicense.swift' (8/55)
Linting 'Options.swift' (9/55)
Linting 'Manual.swift' (10/55)
Linting 'Library.swift' (11/55)
Linting 'ResultOperation.swift' (12/55)
Linting 'APIKit.extension.swift' (13/55)
Linting 'HasName.swift' (14/55)
Linting 'URL.extension.swift' (15/55)
Linting 'LicensePlistHolder.swift' (16/55)
Linting 'Config.swift' (17/55)
Linting 'GitHubLibraryConfigFile.swift' (18/55)
Linting 'PlistInfo.swift' (19/55)
Linting 'ManualLicense.swift' (20/55)
Linting 'LicenseHTMLHolder.swift' (21/55)
Linting 'CocoaPods.swift' (22/55)
Linting 'VersionInfo.swift' (23/55)
Linting 'GitHubLicense.swift' (24/55)
Linting 'License.swift' (25/55)
Linting 'LicenseMarkdownHolder.swift' (26/55)
Linting 'GitHub.swift' (27/55)
Linting 'SwiftPackage.swift' (28/55)
Linting 'XcodeProjectFileReader.swift' (29/55)
Linting 'SwiftPackageFileReader.swift' (30/55)
Linting 'FileReader.swift' (31/55)
Linting 'Logger.swift' (32/55)
Linting 'Shell.swift' (33/55)
Linting 'LicensePlist.swift' (34/55)
/Users/mono/Git/LicensePlist/Sources/LicensePlistCore/Entity/FileReader/XcodeProjectFileReader.swift:10:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
Linting 'ViewController.swift' (35/55)
Linting 'AppDelegate.swift' (36/55)
Linting 'SceneDelegate.swift' (37/55)
Linting 'URL.extensionTests.swift' (38/55)
Linting 'RepoRequestsTests.swift' (39/55)
Linting 'SearchRequestsTests.swift' (40/55)
Linting 'ConfigTests.swift' (41/55)
Linting 'GitHubLibraryConfigFileTests.swift' (42/55)
Linting 'LicensePlistHolderTests.swift' (43/55)
Linting 'PlistInfoTests.swift' (44/55)
Linting 'GitHubLibraryConfigFileTypeTests.swift' (45/55)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/SceneDelegate.swift:52:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/SceneDelegate.swift:19:19: warning: Unused Optional Binding Violation: Prefer `!= nil` over `let _ =` (unused_optional_binding)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/SceneDelegate.swift:14:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/SceneDelegate.swift:50:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/ViewController.swift:19:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/ViewController.swift:17:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
Linting 'CocoaPodsTests.swift' (46/55)
Linting 'LicenseTests.swift' (47/55)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/AppDelegate.swift:36:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/AppDelegate.swift:14:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 3. (vertical_whitespace)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject/SwiftPackageManagerTestProject/AppDelegate.swift:34:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
Linting 'SwiftPackageManagerTests.swift' (48/55)
Linting 'GitHubTests.swift' (49/55)
Linting 'GitHubLicense.collectorTests.swift' (50/55)
Linting 'VersionInfoTests.swift' (51/55)
Linting 'TestUtil.swift' (52/55)
Linting 'XcodeProjectFileReaderTests.swift' (53/55)
Linting 'SwiftPackageFileReaderTests.swift' (54/55)
Linting 'ResultOperationTests.swift' (55/55)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/TestUtil.swift:6:1: warning: Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/Entity/FileReader/XcodeProjectFileReaderTests.swift:45:5: warning: Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 67 lines (function_body_length)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/Entity/FileReader/XcodeProjectFileReaderTests.swift:116:5: warning: Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 76 lines (function_body_length)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/Entity/FileReader/XcodeProjectFileReaderTests.swift:196:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
/Users/mono/Git/LicensePlist/Tests/LicensePlistTests/Entity/FileReader/XcodeProjectFileReaderTests.swift:215:1: warning: Vertical Whitespace Violation: Limit vertical whitespace to a single empty line. Currently 2. (vertical_whitespace)
Done linting! Found 15 violations, 0 serious in 55 files.
As for SwiftPackageManagerTestProject
, it can be ignored by specifying like this at swiftlint.yml
.
excluded:
- Tests/LicensePlistTests/XcodeProjects/SwiftPackageManagerTestProject
A real project is useful to test a function or object of reading xcodeproj file.
Prepare for testing.
Check whether current implementation implementation works or not.
@mono0926 Thanks for comments. |
name: "LicensePlistTests", | ||
dependencies: ["LicensePlistCore"], | ||
exclude: [ | ||
"XcodeProjects" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could exclude the test xcode-projects directory by specifying it in Package.swift.
@mono0926 Thank you! I've fixed things you reviewed yesterday. |
@yosshi4486 |
About
I fixed swift package license's generation issue.
What happen?
I had encountered issue that LicensePlist doesn't generate swift package licenses.
Why does the problem occur?
Xcode has its own project.xcworkspace in its subdirectory, and developer can add additional xcworkspace, in most cases it is via Cocoapods.
Reason
Either project.xcworkspace's Package.resolved or YourAdded.xcworkspace's Package.resolved is updated. Not both. Implementation of swift package integration in this repository didn't care the behavior, so old Package.resolved is referred in some situations.
How did you solve it?
Compare modification dates of these files.
(Sources/LicensePlistCore/Entity/FileReader/XcodeProjectFileReader.swift)
How did you implement it?
Who encounter the problem?
A developer who used swift package in early stage of product development, and added cocoapods integration later.
Review Points
🙅♂️Changes from Tests/LicensePlistTests/XcodeProjects are not important, They are only test resource files.
🙆♂️Changes from Sources/LicensePlistCore/Entity/FileReader and Tests/LicensePlistTests/Entity/FileReader are important. They are core implementations and tests about this PR.
Pass tests?
I run all tests locally by cmd +U.
Related issues?
#140
Other things?
If maintainers allow the refactoring of FileReader, I'd like to rewrite other "readXxx" functions in next pr.