Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Dec 15, 2023
1 parent e666e1e commit a2e85b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/actions/publish-spotbugs-reports/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35352,17 +35352,18 @@ const { readFileSync } = __nccwpck_require__(7147)

function bugAnnotation(bug) {
if (Object.hasOwn(bug, 'Method') && !Array.isArray(bug.Method)) {
const title = bug['@_bad_practice']
const message = bug.ShortMessage
console.log(`Processing ${JSON.stringify(bug, null, 4)}`)
const title = `${bug.ShortMessage} (${bug['@_category']})`
const message = `${bug.LongMessage}\n\nSummary:\n...`
const rawDetails = bug.LongMessage
const path = bug.Method.SourceLine.hasOwn('@_relSourcePath')
const path = bug.Method.SourceLine.hasOwnProperty('@_relSourcePath')
? bug.Method.SourceLine['@_relSourcepath']
: bug.Method.SourceLine['@_sourcepath']
return {
title: title,
message: message,
raw_details: rawDetails,
path: bug.Method.SourceLine['@_relSourcepath'],
path: path,
start_line: Number(bug.Method.SourceLine['@_start']),
end_line: Number(bug.Method.SourceLine['@_end']),
annotation_level: 'warning',
Expand Down Expand Up @@ -35480,7 +35481,10 @@ async function publishCheckRun(annotations) {
async function run() {
try {
const annotations = await getAnnotations()
await publishCheckRun(annotations)
for (let annotation of annotations) {
console.log(`Annotation: ${JSON.stringify(annotation, null, 4)}`)
}
// await publishCheckRun(annotations)
} catch (error) {
core.setFailed(error.message)
}
Expand Down
14 changes: 9 additions & 5 deletions .github/actions/publish-spotbugs-reports/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ const { readFileSync } = require('fs')

function bugAnnotation(bug) {
if (Object.hasOwn(bug, 'Method') && !Array.isArray(bug.Method)) {
const title = bug['@_bad_practice']
const message = bug.ShortMessage
console.log(`Processing ${JSON.stringify(bug, null, 4)}`)
const title = `${bug.ShortMessage} (${bug['@_category']})`
const message = `${bug.LongMessage}\n\nSummary:\n...`
const rawDetails = bug.LongMessage
const path = bug.Method.SourceLine.hasOwn('@_relSourcePath')
const path = bug.Method.SourceLine.hasOwnProperty('@_relSourcePath')
? bug.Method.SourceLine['@_relSourcepath']
: bug.Method.SourceLine['@_sourcepath']
return {
title: title,
message: message,
raw_details: rawDetails,
path: bug.Method.SourceLine['@_relSourcepath'],
path: path,
start_line: Number(bug.Method.SourceLine['@_start']),
end_line: Number(bug.Method.SourceLine['@_end']),
annotation_level: 'warning',
Expand Down Expand Up @@ -134,7 +135,10 @@ async function publishCheckRun(annotations) {
async function run() {
try {
const annotations = await getAnnotations()
await publishCheckRun(annotations)
for (let annotation of annotations) {
console.log(`Annotation: ${JSON.stringify(annotation, null, 4)}`)
}
// await publishCheckRun(annotations)
} catch (error) {
core.setFailed(error.message)
}
Expand Down

0 comments on commit a2e85b6

Please sign in to comment.