How to use @commitlint/ensure - 10 common examples

To help you get started, we’ve selected a few @commitlint/ensure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conventional-changelog / commitlint / @commitlint / rules / src / scope-case.js View on Github external
			segment => delimiters.test(segment) || ensure.case(segment, check.case)
		);
github conventional-changelog / commitlint / @commitlint / rules / src / subject-max-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.subject;

	if (!input) {
		return [true];
	}

	return [
		maxLength(input, value),
		`subject must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / type-max-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.type;

	if (!input) {
		return [true];
	}

	return [
		maxLength(input, value),
		`type must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / body-max-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.body;

	if (!input) {
		return [true];
	}

	return [
		maxLength(input, value),
		`body must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / footer-max-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.footer;

	if (!input) {
		return [true];
	}

	return [
		maxLength(input, value),
		`footer must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / scope-max-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.scope;

	if (!input) {
		return [true];
	}

	return [
		maxLength(input, value),
		`scope must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / header-max-length.js View on Github external
export default (parsed, when, value) => {
	return [
		maxLength(parsed.header, value),
		`header must not be longer than ${value} characters, current length is ${
			parsed.header.length
		}`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / header-min-length.js View on Github external
export default (parsed, when, value) => {
	return [
		minLength(parsed.header, value),
		`header must not be shorter than ${value} characters, current length is ${
			parsed.header.length
		}`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / scope-min-length.js View on Github external
export default (parsed, when, value) => {
	const input = parsed.scope;
	if (!input) {
		return [true];
	}
	return [
		minLength(input, value),
		`scope must not be shorter than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / footer-min-length.js View on Github external
export default (parsed, when, value) => {
	if (!parsed.footer) {
		return [true];
	}
	return [
		minLength(parsed.footer, value),
		`footer must not be shorter than ${value} characters`
	];
};