Skip to content

Commit 27ab4a1

Browse files
committed
refactor: Rename isDocRelated to isDocsRelated
1 parent 4b5f896 commit 27ab4a1

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

src/generate/semantic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class Semantic {
204204
* TODO: For static sites, not all .md files are docs but that could be configured with a global
205205
* flag. Or recognize Jekyll config.
206206
*/
207-
isDocRelated(): boolean {
207+
isDocsRelated(): boolean {
208208
if (this.extension === ".rst") {
209209
return true;
210210
}
@@ -285,7 +285,7 @@ export class Semantic {
285285
if (this.isChoreRelated()) {
286286
return CONVENTIONAL_TYPE.CHORE;
287287
}
288-
if (this.isDocRelated()) {
288+
if (this.isDocsRelated()) {
289289
return CONVENTIONAL_TYPE.DOCS;
290290
}
291291
if (this.isTestRelated()) {

src/test/generate/semantic.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ import { getSemanticConvention, Semantic } from "../../generate/semantic";
33
import { ACTION, CONVENTIONAL_TYPE } from "../../lib/constants";
44

55
describe("Test #Semantic class for path-based conventional commit logic", function () {
6-
describe("#isDocRelated()", function () {
6+
describe("#isDocsRelated()", function () {
77
it("determines that a README file is a doc", function () {
8-
assert.strictEqual(new Semantic("README.md").isDocRelated(), true);
9-
assert.strictEqual(new Semantic("README.rst").isDocRelated(), true);
10-
assert.strictEqual(new Semantic("Readme.txt").isDocRelated(), true);
11-
assert.strictEqual(new Semantic("readme").isDocRelated(), true);
8+
assert.strictEqual(new Semantic("README.md").isDocsRelated(), true);
9+
assert.strictEqual(new Semantic("README.rst").isDocsRelated(), true);
10+
assert.strictEqual(new Semantic("Readme.txt").isDocsRelated(), true);
11+
assert.strictEqual(new Semantic("readme").isDocsRelated(), true);
1212

13-
assert.strictEqual(new Semantic("FEEDME.md").isDocRelated(), false);
13+
assert.strictEqual(new Semantic("FEEDME.md").isDocsRelated(), false);
1414
});
1515

1616
it("determines that a CONTRIBUTING file is a doc", function () {
17-
assert.strictEqual(new Semantic("CONTRIBUTING.md").isDocRelated(), true);
18-
assert.strictEqual(new Semantic("contributing.md").isDocRelated(), true);
17+
assert.strictEqual(new Semantic("CONTRIBUTING.md").isDocsRelated(), true);
18+
assert.strictEqual(new Semantic("contributing.md").isDocsRelated(), true);
1919
});
2020

2121
it("determines that a `.rst` file is a doc", function () {
22-
assert.strictEqual(new Semantic("README.rst").isDocRelated(), true);
23-
assert.strictEqual(new Semantic("foo.rst").isDocRelated(), true);
22+
assert.strictEqual(new Semantic("README.rst").isDocsRelated(), true);
23+
assert.strictEqual(new Semantic("foo.rst").isDocsRelated(), true);
2424
});
2525

2626
it("determines a file in the docs directory is a doc", function () {
27-
assert.strictEqual(new Semantic("docs/fizz.md").isDocRelated(), true);
28-
assert.strictEqual(new Semantic("docs/foo.img").isDocRelated(), true);
27+
assert.strictEqual(new Semantic("docs/fizz.md").isDocsRelated(), true);
28+
assert.strictEqual(new Semantic("docs/foo.img").isDocsRelated(), true);
2929

3030
assert.strictEqual(
31-
new Semantic("docs/fizz/foo.img").isDocRelated(),
31+
new Semantic("docs/fizz/foo.img").isDocsRelated(),
3232
true
3333
);
3434

35-
assert.strictEqual(new Semantic("fuzz/fizz.md").isDocRelated(), false);
35+
assert.strictEqual(new Semantic("fuzz/fizz.md").isDocsRelated(), false);
3636
});
3737
});
3838

0 commit comments

Comments
 (0)