Skip to content

Commit c26adb5

Browse files
committed
docs: update convCommit.ts
1 parent 26e51bc commit c26adb5

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

src/generate/convCommit.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
22
* Conventional Commit module.
33
*
4-
* Process file paths and how they changed and generate a type like 'chore' or 'docs'.
4+
* Process file paths and how they changed and generate a type like 'chore' or
5+
* 'docs'.
56
*/
67
import { ACTION, CONVENTIONAL_TYPE } from "../lib/constants";
78
import { splitPath } from "../lib/paths";
@@ -30,7 +31,8 @@ const PACKAGE_DIRS = [
3031
"Gemfile",
3132
"Gemfile.lock",
3233

33-
// NPM (Exclude package.json since it can be used for metadata and not package always changes.)
34+
// NPM (Exclude package.json since it can be used for metadata and not
35+
// package always changes.)
3436
"package-lock.json",
3537
"shrinkwrap.json",
3638
"yarn.lock",
@@ -90,10 +92,11 @@ const BUILD_NAMES = [
9092
".gradle",
9193
];
9294

93-
// This may be too broad or clash with other areas such as CI or package, unless used close to LAST
94-
// in the entire flow.
95-
// Note also that prettier and ESLint configs with various extensions are handled in isConfigRelated
96-
// so don't have to be listed explictly. Though those strings should be moved out of the function.
95+
// This may be too broad or clash with other areas such as CI or package, unless
96+
// used close to LAST in the entire flow.
97+
// Note also that prettier and ESLint configs with various extensions are
98+
// handled in isConfigRelated so don't have to be listed explictly. Though those
99+
// strings should be moved out of the function.
97100
const CONFIG_EXTENSIONS = [".yml", ".yaml", ".json", ".toml", ".ini", ".cfg"],
98101
CONFIG_DIRS = [".vscode"],
99102
CONFIG_NAMES = [
@@ -233,7 +236,7 @@ const DOC_NAMES = [
233236
*
234237
* This ignores the action such as create/delete file.
235238
*
236-
* For move or rename cases, the input path is assumed to be the `to` path path
239+
* For move or rename cases, the input path is assumed to be the `to` path
237240
* as that would more useful than knowing the `from` path.
238241
*/
239242
export class ConventionalCommit {
@@ -243,13 +246,16 @@ export class ConventionalCommit {
243246
extension: string;
244247

245248
constructor(filePath: string) {
246-
// TODO It is worth keeping splitPath on its own for separation of concerns, but
247-
// could it work better as a class? And then conv commit can inherit from it.
249+
// TODO It is worth keeping splitPath on its own for separation of concerns,
250+
// but could it work better as a class? And then conv commit can inherit
251+
// from it.
248252
// The properties are actually all the same her as there (duplication), only the conv commit
249253
// methods get added here as new.
254+
//
250255
// Maybe a class is overkill as it is just a container of data.
251-
// Maybe the {} can be stored an object here. Or maybe combine that and this at the risk
252-
// of doing too much. But still easy to test attributes vs methods.
256+
// Maybe the {} can be stored an object here. Or maybe combine that and this
257+
// at the risk of doing too much. But still easy to test attributes vs
258+
// methods.
253259
const { atRoot, dirPath, name, extension } = splitPath(filePath);
254260
this.atRoot = atRoot;
255261
this.dirPath = dirPath;

0 commit comments

Comments
 (0)