Skip to content
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 linting in CI using Detekt with SARIF output #229

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

nielsvanvelzen
Copy link
Member

@nielsvanvelzen nielsvanvelzen commented Apr 17, 2021

Adds linting using Detekt with SARIF files.

Part of #220

uses: github/codeql-action/upload-sarif@v1
if: ${{ always() }}
with:
sarif_file: .
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool can only use a single directory/file as input and will recursively search for any .sarif file. Using . will use the project directory to search in, this will search all directories in the project which might be slow (relatively speaking) but it will at least find all sarif files, even if we add more tools.

@@ -70,5 +70,10 @@ subprojects {
buildUponDefaultConfig = true
ignoreFailures = true
config = files("$rootDir/detekt.yml")
basePath = rootDir.absolutePath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ for relative paths in the linter output

@@ -10,7 +10,7 @@ object Plugins {
object Versions {
const val kotlin = "1.4.30"
const val binaryCompatibilityValidatorVersion = "0.5.0"
const val detekt = "1.14.2"
const val detekt = "1.16.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sarif supported starting from 1.15, updated to latest

@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review April 17, 2021 08:12
@nielsvanvelzen nielsvanvelzen mentioned this pull request Apr 17, 2021
@nielsvanvelzen nielsvanvelzen changed the title Add linting in CI using Detekt with Sarif output Add linting in CI using Detekt with SARIF output Apr 17, 2021
@nielsvanvelzen nielsvanvelzen merged commit ae2b202 into master Apr 17, 2021
@nielsvanvelzen nielsvanvelzen deleted the ci-lint-detekt-sarif branch April 17, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants