Skip to content

Commit

Permalink
fix: rename 'ascii' rule to 'notAscii' rule (the meaning does not cha…
Browse files Browse the repository at this point in the history
…nge)
  • Loading branch information
isuke committed Mar 7, 2018
1 parent 525e83b commit ad79a60
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .git_consistent
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ subject:
rules:
firstLatter: lower
dotAtEnd: false
ascii: false
notAscii: false
issueLink:
type: branch
required: false
Expand All @@ -82,4 +82,4 @@ body:
rules:
firstLatter: upper
dotAtEnd: true
ascii: false
notAscii: false
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ link:https://github.com/isuke/git-consistent/blob/master/sample_type_list.adoc[s
| need dot (`.`) input value's last
| boolean

| `ascii`
| allow ASCII?
| `notAscii`
| Use not ascii symbols
| boolean

| `numberOnly`
Expand Down
4 changes: 2 additions & 2 deletions lib/gen-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const generateDefinitionsFile = (definitionsFileName, answers, dryRun = false) =
rules: {
firstLatter: answers.subjectFirstLatter,
dotAtEnd: answers.subjectDotAtEnd,
ascii: false,
notAscii: false,
}
}

Expand All @@ -134,7 +134,7 @@ const generateDefinitionsFile = (definitionsFileName, answers, dryRun = false) =
rules: {
firstLatter: 'upper',
dotAtEnd: true,
ascii: false,
notAscii: false,
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ const checkValue = (term, value, definition) => {
errorMessages.push(`${term} must be number only.`)
}
break
case 'ascii':
case 'notAscii':
if (!ruleSetting && /[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf]/.test(value)) {
errorMessages.push(`${term} should only alphabet.`)
errorMessages.push(`${term} should only ascii symbols.`)
}
break
default:
Expand Down

0 comments on commit ad79a60

Please sign in to comment.