Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove 50 char limit on title line per new project guidelines #22

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove 50 char limit on title line per new project guidelines
  • Loading branch information
Trott committed Nov 12, 2017
commit 1c33bc0e8cca1249466cd2205805ca63f7a9613b
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@ $ core-validate-commit --list
pr-url enforce PR-URL
reviewers enforce having reviewers
subsystem enforce subsystem validity
title-length enforce max length of commit title
```

## Test
1 change: 0 additions & 1 deletion lib/format-pretty.js
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@ module.exports = function formatPretty(context, msgs, validator, opts) {
}

switch (ruleId) {
case 'title-length':
case 'line-length':
console.log(formatLength(msg, opts))
break
6 changes: 1 addition & 5 deletions lib/format-tap.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ module.exports = function formatTap(t, context, msgs, validator) {
function onFail(context, m, validator, t) {
switch (m.id) {
case 'line-length':
case 'title-length':
lengthFail(context, m, validator, t)
break
case 'subsystem':
@@ -35,17 +34,14 @@ function onFail(context, m, validator, t) {
}

function lengthFail(context, m, validator, t) {
const body = m.id === 'title-length'
? context.title
: context.body
t.fail(`${m.id}: ${m.message}`, {
found: m.string.length
, compare: '<='
, wanted: m.maxLength
, at: {
line: m.line || 0
, column: m.column || 0
, body: body
, body: context.body
}
})
}
39 changes: 0 additions & 39 deletions lib/rules/title-length.js

This file was deleted.

14 changes: 5 additions & 9 deletions test/validator.js
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ test('Validator - misc', (t) => {

test('Validator - real commits', (t) => {
t.test('basic', (tt) => {
tt.plan(18)
tt.plan(12)
const v = new Validator()
// run against the output of git show --quiet
// run against the output of github's get commit api request
@@ -139,9 +139,7 @@ test('Validator - real commits', (t) => {
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
tt.equal(filtered.length, 3, 'messages.length')
tt.equal(filtered[0].level, 'fail')
tt.equal(filtered[0].id, 'title-length')
tt.equal(filtered.length, 0, 'messages.length')
})
})

@@ -159,9 +157,7 @@ test('Validator - real commits', (t) => {
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
tt.equal(filtered.length, 1, 'messages.length')
tt.equal(filtered[0].level, 'fail')
tt.equal(filtered[0].id, 'title-length')
tt.equal(filtered.length, 0, 'messages.length')
tt.end()
})
})
@@ -180,11 +176,11 @@ test('Validator - real commits', (t) => {
const filtered = msgs.filter((item) => {
return item.level === 'fail'
})
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', 'line-length']
tt.deepEqual(ids.sort(), exp.sort(), 'message ids')
tt.end()
})