-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add codeclimate reporter #3425
Add codeclimate reporter #3425
Conversation
Generated by 🚫 Danger |
be6d9ee
to
17fe2f3
Compare
Please Review. One question: The path inside the report is escaped. This is expected?
|
I think that's more of a question for you, what does the Codeclimate format expect? |
17fe2f3
to
b5dcad8
Compare
I couldn't find the spec yet. I followed https://github.com/codeclimate/codeclimate-swiftlint/blob/3cfa6c59e4f66b185e407a4293d5175cf52799ed/Sources/codeclimate-SwiftLint/main.swift#L16 Looking at the gitlab example, the path is not escaped: I thought swiftlint escape the slashes by default. But it looks like a swift feature. (First time doing something with swift...) I changed it. |
Looks good other than the md5 code duplication. |
#if canImport(CommonCrypto) | ||
import CommonCrypto | ||
#else | ||
import CryptoSwift | ||
#endif | ||
import Foundation | ||
|
||
#if canImport(CommonCrypto) | ||
extension String { |
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.
Aren't all these other imports unused?
#if canImport(CommonCrypto) | |
import CommonCrypto | |
#else | |
import CryptoSwift | |
#endif | |
import Foundation | |
#if canImport(CommonCrypto) | |
extension String { | |
#if canImport(CommonCrypto) | |
import CommonCrypto | |
extension String { |
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 thought CryptoSwift
is just fallback, if CommonCrypto
is not available.
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.
Correct, but CryptoSwift already comes with String.md5()
, so what this code does is add the same convenience method to CommonCrypto.
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 just copied the code from Source/SwiftLintFramework/Extensions/Configuration+Cache.swift
, I can't decide if the code could be throw away.
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.
That file uses CryptoSwift but this file doesn’t.
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 suggest to split this in an own issue/pr.
ed78502
to
f50e7f6
Compare
Rebased. Could we merge is feature soon? Looks like the CHANGELOG.md gets conflicted fast if any other PR is merged. I still suggest to split the discussion about the crypto code in a separate PR. |
Thanks for rebasing and keeping this up to date. I pushed up the import changes I had mentioned, fixed the changelog entry and will be merging once CI passes. Thanks for your contribution @jkroepke! |
Thanks! |
Fixes: #3424