-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to assign TODO authors to the created issue
- Loading branch information
Showing
28 changed files
with
651 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# v1.1.0 | ||
## Features | ||
- Assign issues to TODO authors on GitHub | ||
|
||
# v1.0.0 | ||
## Initial release | ||
See [README.md](https://github.com/salsita/todo2issue/blob/v1.0.0/README.md) for usage instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ At the first run, it: | |
- finds TODOs and FIXMEs in your code | ||
- groups them using their text | ||
- creates a GitHub issue for each group with a specific label | ||
- optionally assigns a user to the issue based on the author of the label (see `authorsByEmail` configuration option) | ||
- references the issue in the code-base like `TODO(#123) Do something` | ||
|
||
When ran again, it: | ||
|
@@ -56,7 +57,10 @@ Then you should configure behavior of the tool using `todo2issue` property: | |
"**/*.js?(x)" | ||
], | ||
"issueLabel": "TODO", | ||
"branch": "develop" | ||
"branch": "develop", | ||
"authorsByEmail": { | ||
"[email protected]": "goce-cz" | ||
} | ||
}, | ||
// ... | ||
} | ||
|
@@ -71,6 +75,9 @@ Then you should configure behavior of the tool using `todo2issue` property: | |
- this label **MUST NOT** be assigned / unassigned manually | ||
- `branch` - name of the branch to be used when referencing code from the generated issues | ||
- defaults to active Git branch, but it is highly recommended fixing this in the config | ||
- `authorsByEmail` - mapping between email of a commit author and a GitHub username | ||
- if present, authors of TODOs are assigned to the created issues | ||
- if present, and a mapping for particular email is missing, the sync fails (can be overridden by `--ignore-unresolved-users`) | ||
|
||
### GitHub token | ||
The tool needs GitHub personal access token to interact with GitHub API on your behalf. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "todo2issue", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "CLI tool for in-code TODO synchronization to GitHub issues", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
|
@@ -30,12 +30,12 @@ | |
"homepage": "https://github.com/salsita/todo2issue#readme", | ||
"dependencies": { | ||
"@expo/spawn-async": "^1.5.0", | ||
"@octokit/rest": "^18.12.0", | ||
"dotenv": "^10.0.0", | ||
"escape-string-regexp": "^4.0.0", | ||
"git-url-parse": "^11.6.0", | ||
"globby": "^11.0.4", | ||
"leasot": "^12.0.0", | ||
"@octokit/rest": "^18.12.0", | ||
"read-package-json": "^4.1.1", | ||
"tslib": "^2.3.1", | ||
"yargs": "^17.2.1" | ||
|
@@ -47,5 +47,15 @@ | |
"jest": "^27.2.5", | ||
"ts-jest": "^27.0.6", | ||
"typescript": "^4.4.4" | ||
}, | ||
"todo2issue": { | ||
"filePatterns": [ | ||
"sample/**/*.ts?(x)", | ||
"sample/**/*.js?(x)" | ||
], | ||
"branch": "master", | ||
"authorsByEmail": { | ||
"[email protected]": "goce-cz" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,13 @@ | |
|
||
exports[`readRepositoryConfig reads 1`] = ` | ||
Object { | ||
"authorsByEmail": Object { | ||
"[email protected]": "goce-cz", | ||
}, | ||
"branch": "master", | ||
"filePatterns": Array [ | ||
"**/*.ts?(x)", | ||
"**/*.js?(x)", | ||
"sample/**/*.ts?(x)", | ||
"sample/**/*.js?(x)", | ||
], | ||
"issueLabel": "TODO", | ||
"repo": Object { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`findAuthors finds authors 1`] = ` | ||
Array [ | ||
Object { | ||
"author": "goce-cz", | ||
"filename": "sample/src/index.ts", | ||
"line": 1, | ||
"tag": "TODO", | ||
"text": "A", | ||
}, | ||
Object { | ||
"author": "goce-cz", | ||
"filename": "sample/src/index.ts", | ||
"line": 4, | ||
"tag": "TODO", | ||
"text": "B", | ||
}, | ||
Object { | ||
"author": "goce-cz", | ||
"filename": "sample/src/helpers/helper.ts", | ||
"line": 1, | ||
"tag": "TODO", | ||
"text": "C", | ||
}, | ||
Object { | ||
"author": "goce-cz", | ||
"filename": "sample/src/index.ts", | ||
"line": 16, | ||
"tag": "TODO", | ||
"text": "line comments", | ||
}, | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`generateIssueBody generates description of issue 1`] = ` | ||
"--- | ||
_This issue origins from a TODO within the code-base and was synchronized automatically._ | ||
## Occurrences | ||
### \`sample/src/index.ts\` | ||
- [line 1](https://github.com/salsita/todo2issue/blob/master/sample/src/index.ts#L1) - Single line todo comment | ||
- [line 2](https://github.com/salsita/todo2issue/blob/master/sample/src/index.ts#L2) - Single line todo comment with reference | ||
---" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`parseBlameInfo parses blame info 1`] = ` | ||
Array [ | ||
Object { | ||
"author": Object { | ||
"email": "[email protected]", | ||
"name": "Jiří Staniševský", | ||
"time": 1634279203, | ||
"timeZone": "+0200", | ||
}, | ||
"commitHash": "aa73a7deb88f1487c0006abcd3b684bf91c2266e", | ||
"committer": Object { | ||
"email": "<[email protected]>", | ||
"name": "Jiří Staniševský", | ||
"time": 1634279340, | ||
"timeZone": "+0200", | ||
}, | ||
"filename": "sample/src/index.ts", | ||
"lineEnd": 1, | ||
"lineStart": 1, | ||
"summary": "Add sample \\"code-base\\"", | ||
"text": Array [ | ||
" // TODO Single line todo comment", | ||
], | ||
}, | ||
Object { | ||
"author": Object { | ||
"email": "[email protected]", | ||
"name": "Jiří Staniševský", | ||
"time": 1634279489, | ||
"timeZone": "+0200", | ||
}, | ||
"commitHash": "be1ec0218067e7152167afaf1de0f84e6c55fd43", | ||
"committer": Object { | ||
"email": "<[email protected]>", | ||
"name": "Jiří Staniševský", | ||
"time": 1634281973, | ||
"timeZone": "+0200", | ||
}, | ||
"filename": "sample/src/index.ts", | ||
"lineEnd": 4, | ||
"lineStart": 4, | ||
"summary": "Scanning WiP", | ||
"text": Array [ | ||
" // TODO(#123) Same reference different comment", | ||
], | ||
}, | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`groupTodosToIssues groups 1`] = ` | ||
Array [ | ||
Object { | ||
"issueNumber": 123, | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": 123, | ||
"line": 2, | ||
"tag": "TODO", | ||
"text": "Single line todo comment with reference", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": 123, | ||
"line": 4, | ||
"tag": "TODO", | ||
"text": "Same reference different comment", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 5, | ||
"tag": "TODO", | ||
"text": "Same reference different comment", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"issueNumber": 124, | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": 124, | ||
"line": 12, | ||
"tag": "TODO", | ||
"text": "Multiline todo", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 7, | ||
"tag": "TODO", | ||
"text": "Multiline todo", | ||
}, | ||
Object { | ||
"filename": "src/helpers/helper.ts", | ||
"issueNumber": undefined, | ||
"line": 4, | ||
"tag": "TODO", | ||
"text": "Multiline todo", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"issueNumber": 125, | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": 125, | ||
"line": 19, | ||
"tag": "TODO", | ||
"text": "Multiple single", | ||
}, | ||
Object { | ||
"filename": "src/helpers/helper.ts", | ||
"issueNumber": 125, | ||
"line": 7, | ||
"tag": "TODO", | ||
"text": "Related issue", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 15, | ||
"tag": "TODO", | ||
"text": "Multiple single", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 1, | ||
"tag": "TODO", | ||
"text": "Single line todo comment", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 16, | ||
"tag": "TODO", | ||
"text": "line comments", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 20, | ||
"tag": "TODO", | ||
"text": "line comments with reference", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 22, | ||
"tag": "TODO", | ||
"text": "With colon", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 24, | ||
"tag": "TODO", | ||
"text": "With colon", | ||
}, | ||
Object { | ||
"filename": "src/index.ts", | ||
"issueNumber": undefined, | ||
"line": 26, | ||
"tag": "TODO", | ||
"text": "With colon", | ||
}, | ||
], | ||
}, | ||
Object { | ||
"todos": Array [ | ||
Object { | ||
"filename": "src/helpers/helper.ts", | ||
"issueNumber": undefined, | ||
"line": 1, | ||
"tag": "TODO", | ||
"text": "This one is from a sub-folder", | ||
}, | ||
], | ||
}, | ||
] | ||
`; |
Oops, something went wrong.