Skip to content

Commit

Permalink
Fix handling of case with 0 violations
Browse files Browse the repository at this point in the history
  • Loading branch information
jwgmeligmeyling committed Jun 14, 2020
1 parent 982e408 commit 5791e9b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ And do not forget to enable XML output for the Maven plugin:
</build>
```

## Other relevant actions
This is a Github Action in a series of other GitHub Actions. Similar actions include:

* [checkstyle-github-action](https://github.com/jwgmeligmeyling/checkstyle-github-action)
* [pmd-github-action](https://github.com/jwgmeligmeyling/pmd-github-action)
* [spotbugs-github-action](https://github.com/jwgmeligmeyling/spotbugs-github-action)

## Contributing

Install the dependencies
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8474,7 +8474,9 @@ function run() {
core.debug(`Root artifact directory is ${searchResult.rootDirectory}`);
const annotations = ramda_1.chain(annotations_1.annotationsForPath, searchResult.filesToUpload);
core.debug(`Grouping ${annotations.length} annotations into chunks of ${MAX_ANNOTATIONS_PER_REQUEST}`);
const groupedAnnotations = ramda_1.splitEvery(MAX_ANNOTATIONS_PER_REQUEST, annotations);
const groupedAnnotations = annotations.length > MAX_ANNOTATIONS_PER_REQUEST
? ramda_1.splitEvery(MAX_ANNOTATIONS_PER_REQUEST, annotations)
: [annotations];
core.debug(`Created ${groupedAnnotations.length} buckets`);
for (const annotationSet of groupedAnnotations) {
yield createCheck(name, title, annotationSet, annotations.length);
Expand Down
9 changes: 5 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ async function run(): Promise<void> {
`Grouping ${annotations.length} annotations into chunks of ${MAX_ANNOTATIONS_PER_REQUEST}`
)

const groupedAnnotations: Annotation[][] = splitEvery(
MAX_ANNOTATIONS_PER_REQUEST,
annotations
)
const groupedAnnotations: Annotation[][] =
annotations.length > MAX_ANNOTATIONS_PER_REQUEST
? splitEvery(MAX_ANNOTATIONS_PER_REQUEST, annotations)
: [annotations]

core.debug(`Created ${groupedAnnotations.length} buckets`)

for (const annotationSet of groupedAnnotations) {
Expand Down

0 comments on commit 5791e9b

Please sign in to comment.