Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-validate-commit

Package Overview
Dependencies
Maintainers
3
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-validate-commit - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

6

lib/rules/line-length.js

@@ -34,2 +34,8 @@ 'use strict'

const line = parsed.body[i]
// Skip quoted lines, e.g. for original commit messages of V8 backports.
if (line.startsWith(' '))
continue
// Skip lines with URLs.
if (/https?:\/\//.test(line))
continue
if (line.length > len) {

@@ -36,0 +42,0 @@ failed = true

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -70,3 +70,67 @@ 'use strict'

t.test('quoted lines', (tt) => {
const v = new Validator()
const context = new Commit({
sha: 'e7c077c610afa371430180fbd447bfef60ebc5ea'
, author: {
name: 'Evan Lucas'
, email: 'evanlucas@me.com'
, date: '2016-04-12T19:42:23Z'
}
, message: `src: make foo mor foo-ey
Here’s the original code:
${'aaa'.repeat(30)}
That was the original code.
`
}, v)
context.report = (opts) => {
tt.pass('called report')
tt.equal(opts.id, 'line-length', 'id')
tt.equal(opts.string, '', 'string')
tt.equal(opts.level, 'pass', 'level')
}
Rule.validate(context, {
options: {
length: 72
}
})
tt.end()
})
t.test('URLs', (tt) => {
const v = new Validator()
const context = new Commit({
sha: 'e7c077c610afa371430180fbd447bfef60ebc5ea'
, author: {
name: 'Evan Lucas'
, email: 'evanlucas@me.com'
, date: '2016-04-12T19:42:23Z'
}
, message: `src: make foo mor foo-ey
https://${'very-'.repeat(80)}-long-url.org/
`
}, v)
context.report = (opts) => {
tt.pass('called report')
tt.equal(opts.id, 'line-length', 'id')
tt.equal(opts.string, '', 'string')
tt.equal(opts.level, 'pass', 'level')
}
Rule.validate(context, {
options: {
length: 72
}
})
tt.end()
})
t.end()
})

@@ -208,7 +208,7 @@ 'use strict'

})
tt.equal(filtered.length, 3, 'messages.length')
tt.equal(filtered.length, 2, 'messages.length')
const ids = filtered.map((item) => {
return item.id
})
const exp = ['line-length', 'line-length', 'title-length']
const exp = ['line-length', 'title-length']
tt.deepEqual(ids.sort(), exp.sort(), 'message ids')

@@ -215,0 +215,0 @@ tt.end()

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc