common/travis/xlint.sh: print Github annotations
Turns xlint, version lint, and commit lint messages into warning or error annotaions. All are printed with special highlighting in the action log and summary. Xlint and version lint annotations are shown inline in the changes tab and commit view. Annotations without line number are shown at line 1.
This commit is contained in:
@@ -35,18 +35,18 @@ do
|
||||
/^$/ && !msg { msg = 1; next }
|
||||
!msg { next }
|
||||
# 3: long-line-is-banned-except-footnote-like-this-for-url
|
||||
(NF > 2) && (length > 80) { print C ": long line: " $0; exit 1 }
|
||||
(NF > 2) && (length > 80) { print "::error title=Commit Lint::" C ": long line: " $0; exit 1 }
|
||||
!subject {
|
||||
if (length > 50) { print C ": subject is a bit long" }
|
||||
if (!($0 ~ ":" || $0 ~ "^Take over maintainership " || $0 ~ "^Orphan ")) { print C ": subject does not follow CONTRIBUTING.md guildelines"; exit 1 }
|
||||
if (length > 50) { print "::warning title=Commit Lint::" C ": subject is a bit long" }
|
||||
if (!($0 ~ ":" || $0 ~ "^Take over maintainership " || $0 ~ "^Orphan ")) { print "::error title=Commit Lint::" C ": subject does not follow CONTRIBUTING.md guildelines"; exit 1 }
|
||||
# Below check is too noisy?
|
||||
# if (!($0 ~ "^New package:" || $0 ~ ".*: update to")) {
|
||||
# print C ": not new package/update/removal?"
|
||||
# print "::warning title=Commit Lint::" C ": not new package/update/removal?"
|
||||
# }
|
||||
subject = 1; next
|
||||
}
|
||||
/^$/ { body = 1; next }
|
||||
!body { print C ": second line must be blank"; exit 1 }
|
||||
!body { print "::error title=Commit Lint::" C ": second line must be blank"; exit 1 }
|
||||
' || status=1
|
||||
done
|
||||
exit $status
|
||||
|
Reference in New Issue
Block a user