Skip to content

Commit

Permalink
fix: Do not report unknown messqge types as notices
Browse files Browse the repository at this point in the history
If the report is generated as a pure list of succeeded files with
messages of no severity, do not report these as empty notices.
  • Loading branch information
prantlf committed Jan 28, 2018
1 parent 740ec34 commit 8817c58
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Ferdinand Prantl
Copyright (c) 2017-2018 Ferdinand Prantl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

## Release History

* 2018-01-27 v0.2.2 Do not report unknown messqge types as notices
* 2017-11-25 v0.2.1 Support Node.js < 7
* 2017-11-24 v0.2.0 Fix recognition of warnings,
say "notices" instead of "notes"
* 2017-11-24 v0.0.1 Initial release

## License

Copyright (c) 2017 Ferdinand Prantl
Copyright (c) 2017-2018 Ferdinand Prantl

Licensed under the MIT license.

Expand Down
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ module.exports = function (results) {
if (severity === 'error' || severity === 'non-document-error') {
++errorCount
issues = file.errors
} else if (severity === 'info' && result.subType === 'warning') {
++warningCount
issues = file.warnings
} else if (severity === 'info') {
if (result.subType === 'warning') {
++warningCount
issues = file.warnings
} else {
++noticeCount
issues = file.notices
}
} else {
++noticeCount
issues = file.notices
issues = []
}
issues.push({
line: result.lastLine,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"object.values": "^1.0.4"
},
"devDependencies": {
"semantic-release": "^11.0.2",
"semantic-release": "^12.4.1",
"standard": "^10.0.3",
"tap": "^11.0.0"
"tap": "^11.0.1"
},
"keywords": [
"grunt-tasks",
Expand Down

0 comments on commit 8817c58

Please sign in to comment.