Repository: conventional-changelog/commitlint (TypeScript)

Issue:
fix: subject-full-stop doesn't work if type contains dot
### Expected Behavior

subject-full-stop should flag commit msg as wrong.

### Current Behavior

subject-full-stop considers commit msg as fine.

### Affected packages

- [X] cli
- [X] core
- [ ] prompt
- [ ] config-angular

### Possible Solution

_No response_

### Steps to Reproduce

1. Configure commitlint with:

```
module.exports = {
    parserPreset: "conventional-changelog-conventionalcommits",
    rules: {
        "type-enum": [
            RuleConfigSeverity.Error,
            "always",
            ["fix", "docs", "ci.build", "ci.tests"],
        ],
        "subject-full-stop": [RuleConfigSeverity.Error, "never", "."],

```
2. Commit with a msg "fix: foo", commitlint exit code is 0: good.
3. Commit with a msg "fix: foo.", commitlint exit code is not 0: good.
4. Commit with a msg "ci.build: foo.", commitlint exit code is 0: bug.


### Context

_No response_

### commitlint --version

17.0.0

### git --version

2.34.1

### node --version

12.22.9


Discussion:

Patch:
diff --git a/@commitlint/rules/src/subject-full-stop.ts b/@commitlint/rules/src/subject-full-stop.ts
index 050a4f7b16..91c0d9bb42 100644
--- a/@commitlint/rules/src/subject-full-stop.ts
+++ b/@commitlint/rules/src/subject-full-stop.ts
@@ -6,12 +6,14 @@ export const subjectFullStop: SyncRule<string> = (
 	when = 'always',
 	value = '.'
 ) => {
-	const input = parsed.subject;
 
-	if (!input) {
+	let colonIndex = parsed.header.indexOf(':');
+	if (colonIndex > 0 && colonIndex === parsed.header.length - 1) {
 		return [true];
 	}
 
+	const input = parsed.header;
+
 	const negated = when === 'never';
 	const hasStop = input[input.length - 1] === value;
 


Test patch:
diff --git a/@commitlint/rules/src/subject-full-stop.test.ts b/@commitlint/rules/src/subject-full-stop.test.ts
index c6587adecd..734b4644ad 100644
--- a/@commitlint/rules/src/subject-full-stop.test.ts
+++ b/@commitlint/rules/src/subject-full-stop.test.ts
@@ -5,12 +5,16 @@ const messages = {
 	empty: 'test:\n',
 	with: `test: subject.\n`,
 	without: `test: subject\n`,
+	standardScopeWith: `type(scope): subject.\n`,
+	nonStandardScopeWith: "type.scope: subject.\n"
 };
 
 const parsed = {
 	empty: parse(messages.empty),
 	with: parse(messages.with),
 	without: parse(messages.without),
+	standardScopeWith: parse(messages.standardScopeWith),
+	nonStandardScopeWith: parse(messages.nonStandardScopeWith),
 };
 
 test('empty against "always" should succeed', async () => {
@@ -48,3 +52,15 @@ test('without against "never ." should succeed', async () => {
 	const expected = true;
 	expect(actual).toEqual(expected);
 });
+
+test('commit message title with standard scope and full-stop against "never ." should fail', async () => {
+	const [actual] = subjectFullStop(await parsed.standardScopeWith, 'never', '.');
+	const expected = false;
+	expect(actual).toEqual(expected);
+});
+
+test('commit message title with non standard scope and full-stop against "never ." should fail', async () => {
+	const [actual] = subjectFullStop(await parsed.nonStandardScopeWith, 'never', '.');
+	const expected = false;
+	expect(actual).toEqual(expected);
+});