-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include internal lints in annotations
- Loading branch information
Showing
19 changed files
with
253 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as Buildkite from '../../../../api/buildkite'; | ||
import type { InternalLintResult } from '../../internal'; | ||
|
||
export const createInternalAnnotations = ( | ||
internal: InternalLintResult, | ||
): string[] => | ||
!internal.ok && internal.annotations?.length | ||
? [ | ||
'**skuba**', | ||
Buildkite.md.terminal( | ||
internal.annotations | ||
.map(({ message, path }) => `${path} ${message}`) | ||
.join('\n'), | ||
), | ||
] | ||
: []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type * as GitHub from '../../../../api/github'; | ||
import type { InternalLintResult } from '../../internal'; | ||
|
||
export const createInternalAnnotations = ( | ||
internal: InternalLintResult, | ||
): GitHub.Annotation[] => | ||
(internal.annotations ?? []).map((annotation) => ({ | ||
annotation_level: 'failure', | ||
start_line: annotation.start_line ?? 1, | ||
end_line: annotation.end_line ?? annotation.start_line ?? 1, | ||
path: annotation.path, | ||
message: annotation.message, | ||
title: 'skuba lint', | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
import type { ESLintOutput } from '../../../cli/adapter/eslint'; | ||
import type { PrettierOutput } from '../../../cli/adapter/prettier'; | ||
import type { StreamInterceptor } from '../external'; | ||
import type { InternalLintResult } from '../internal'; | ||
|
||
import { createBuildkiteAnnotations } from './buildkite'; | ||
import { createGitHubAnnotations } from './github'; | ||
|
||
export const createAnnotations = async ( | ||
internal: InternalLintResult, | ||
eslint: ESLintOutput, | ||
prettier: PrettierOutput, | ||
tscOk: boolean, | ||
tscOutputStream: StreamInterceptor, | ||
): Promise<void> => { | ||
await Promise.all([ | ||
createGitHubAnnotations(eslint, prettier, tscOk, tscOutputStream), | ||
createBuildkiteAnnotations(eslint, prettier, tscOk, tscOutputStream), | ||
createGitHubAnnotations(internal, eslint, prettier, tscOk, tscOutputStream), | ||
createBuildkiteAnnotations( | ||
internal, | ||
eslint, | ||
prettier, | ||
tscOk, | ||
tscOutputStream, | ||
), | ||
]); | ||
}; |
Oops, something went wrong.