Socket
Socket
Sign inDemoInstall

core-validate-commit

Package Overview
Dependencies
12
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.5.1 to 3.6.0

lib/rules/title-format.js

4

package.json
{
"name": "core-validate-commit",
"version": "3.5.1",
"version": "3.6.0",
"description": "Validate the commit message for a particular commit in node core",

@@ -8,3 +8,3 @@ "main": "index.js",

"pretest": "lintit && check-pkg",
"test": "tap -j4 --cov test/**/*.js",
"test": "tap -j4 --cov test/**/*.js test/*.js",
"posttest": "tap --coverage-report=text-summary"

@@ -11,0 +11,0 @@ },

@@ -109,2 +109,23 @@ 'use strict'

const str7 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99
Author: Wyatt Preul <wpreul@gmail.com>
Date: Thu Mar 3 10:10:46 2016 -0600
test: check memoryUsage properties.
`
const str8 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99
Author: Wyatt Preul <wpreul@gmail.com>
Date: Thu Mar 3 10:10:46 2016 -0600
test: Check memoryUsage properties
`
const str9 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99
Author: Wyatt Preul <wpreul@gmail.com>
Date: Thu Mar 3 10:10:46 2016 -0600
test: Check memoryUsage properties.
`
test('Validator - misc', (t) => {

@@ -275,3 +296,55 @@ const v = new Validator()

t.test('trailing punctuation in title line', (tt) => {
const v = new Validator({
'validate-metadata': false
})
v.lint(str7)
v.on('commit', (data) => {
const msgs = data.messages
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
tt.equal(filtered.length, 1, 'messages.length')
tt.equal(filtered[0].message,
'Do not use punctuation at end of title.',
'message')
tt.end()
})
})
t.test('first word is lowercase in title line', (tt) => {
const v = new Validator({
'validate-metadata': false
})
v.lint(str8)
v.on('commit', (data) => {
const msgs = data.messages
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
tt.equal(filtered.length, 1, 'messages.length')
tt.equal(filtered[0].message,
'First word after subsystem(s) in title should be lowercase.',
'message')
tt.equal(filtered[0].column, 7, 'column')
tt.end()
})
})
t.test('more than one formatting error in title line', (tt) => {
const v = new Validator({
'validate-metadata': false
})
v.lint(str9)
v.on('commit', (data) => {
const msgs = data.messages
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
tt.equal(filtered.length, 2, 'messages.length')
tt.end()
})
})
t.end()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc