Merge branch 'master' into patch-1

This commit is contained in:
James McMahon 2022-05-20 12:19:19 +01:00 committed by GitHub
commit abbbccdbc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 35 deletions

View File

@ -37,7 +37,7 @@ Create a `workflow.yml` file in your `.github/workflows` directory like:
steps: steps:
- uses: "actions/checkout@master" - uses: "actions/checkout@master"
- name: "TODO to Issue" - name: "TODO to Issue"
uses: "alstr/todo-to-issue-action@v4.6.3" uses: "alstr/todo-to-issue-action@v4.6.4"
id: "todo" id: "todo"
``` ```

View File

@ -1,71 +1,71 @@
name: "TODO to Issue" name: 'TODO to Issue'
description: "Converts IDE TODO comments to GitHub issues" description: 'Converts IDE TODO comments to GitHub issues'
author: "Alastair Mooney" author: 'Alastair Mooney'
runs: runs:
using: "docker" using: 'docker'
image: "docker://ghcr.io/alstr/todo-to-issue-action:v4.6" image: 'docker://ghcr.io/alstr/todo-to-issue-action:v4.6'
branding: branding:
icon: "check-square" icon: 'check-square'
color: "orange" color: 'orange'
inputs: inputs:
REPO: REPO:
description: "The path to the repository where the action will be used, e.g. 'alstr/my-repo' (automatically set)" description: "The path to the repository where the action will be used, e.g. 'alstr/my-repo' (automatically set)"
required: true required: true
default: "${{ github.repository }}" default: '${{ github.repository }}'
BEFORE: BEFORE:
description: "The SHA of the last pushed commit (automatically set)" description: 'The SHA of the last pushed commit (automatically set)'
required: true required: true
default: "${{ github.event.before || github.base_ref }}" default: '${{ github.event.before || github.base_ref }}'
COMMITS: COMMITS:
description: "An array of commit objects describing the pushed commits" description: 'An array of commit objects describing the pushed commits'
required: true required: true
default: "${{ toJSON(github.event.commits) }}" default: '${{ toJSON(github.event.commits) }}'
DIFF_URL: DIFF_URL:
description: "The URL to use to get the diff (automatically set)" description: 'The URL to use to get the diff (automatically set)'
required: true required: true
default: "${{ github.event.pull_request.diff_url }}" default: '${{ github.event.pull_request.diff_url }}'
SHA: SHA:
description: "The SHA of the latest commit (automatically set)" description: 'The SHA of the latest commit (automatically set)'
required: true required: true
default: "${{ github.sha }}" default: '${{ github.sha }}'
TOKEN: TOKEN:
description: "The GitHub access token to allow us to retrieve, create and update issues (automatically set)" description: 'The GitHub access token to allow us to retrieve, create and update issues (automatically set)'
required: false required: false
default: ${{ github.token }} default: ${{ github.token }}
LABEL: LABEL:
description: "The label that will be used to identify TODO comments (deprecated)" description: 'The label that will be used to identify TODO comments (deprecated)'
required: false required: false
COMMENT_MARKER: COMMENT_MARKER:
description: "The marker used to signify a line comment in your code (deprecated)" description: 'The marker used to signify a line comment in your code (deprecated)'
required: false required: false
CLOSE_ISSUES: CLOSE_ISSUES:
description: "Optional input that specifies whether to attempt to close an issue when a TODO is removed" description: 'Optional input that specifies whether to attempt to close an issue when a TODO is removed'
required: true required: true
default: true default: true
AUTO_P: AUTO_P:
description: "For multiline TODOs, format each line as a new paragraph when creating the issue" description: 'For multiline TODOs, format each line as a new paragraph when creating the issue'
required: true required: true
default: true default: true
PROJECTS_SECRET: PROJECTS_SECRET:
description: "Encrypted secret corresponding to your personal access token (do not enter the actual secret)" description: 'Encrypted secret corresponding to your personal access token (do not enter the actual secret)'
required: false required: false
USER_PROJECTS: USER_PROJECTS:
description: "Default user projects" description: 'Default user projects'
required: false required: false
ORG_PROJECTS: ORG_PROJECTS:
description: "Default organisation projects" description: 'Default organisation projects'
required: false required: false
IGNORE: IGNORE:
description: "A collection of comma-delimited regular expression that matches files that should be ignored when searching for TODOs" description: 'A collection of comma-delimited regular expression that matches files that should be ignored when searching for TODOs'
required: false required: false
AUTO_ASSIGN: AUTO_ASSIGN:
description: "Automatically assign new issues to the user who triggered the action" description: 'Automatically assign new issues to the user who triggered the action'
required: true required: true
default: false default: false
ACTOR: ACTOR:
description: "The username of the person who triggered the action" description: 'The username of the person who triggered the action'
required: true required: true
default: "${{ github.actor }}" default: '${{ github.actor }}'
ISSUE_TEMPLATE: ISSUE_TEMPLATE:
description: "The template used to format new issues" description: 'The template used to format new issues'
required: false required: false

View File

@ -365,6 +365,17 @@
"start": "<!--", "start": "<!--",
"end": "-->" "end": "-->"
} }
},
{
"type": "block",
"pattern": {
"start": "{/\\*",
"end": "\\*/}"
}
},
{
"type": "line",
"pattern": "- \\[ \\]"
} }
] ]
}, },
@ -546,7 +557,7 @@
}, },
{ {
"language": "HCL", "language": "HCL",
"markers" : [ "markers": [
{ {
"type": "line", "type": "line",
"pattern": "#" "pattern": "#"
@ -566,7 +577,7 @@
}, },
{ {
"language": "SCSS", "language": "SCSS",
"markers" : [ "markers": [
{ {
"type": "line", "type": "line",
"pattern": "//" "pattern": "//"
@ -578,11 +589,11 @@
"end": "\\*/" "end": "\\*/"
} }
} }
] ]
}, },
{ {
"language": "Twig", "language": "Twig",
"markers" : [ "markers": [
{ {
"type": "block", "type": "block",
"pattern": { "pattern": {

View File

@ -222,6 +222,30 @@ index 525e25d..ba4e68d 100644
- also need to be turned into todos, and hopefully - also need to be turned into todos, and hopefully
- kept together as one todo - kept together as one todo
- #} - #}
diff --git a/tests/example_file.md b/src/tests/example_file.md
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.md
+++ b/src/tests/example_file.md
@@ -1,7 +0,0 @@
- {/* TODO: Hopefully this comment turns into a todo issue */}
- {/*
- TODO:Multiline comments
- also need to be turned into todos, and hopefully
- kept together as one todo
- */}
- - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
index 525e25d..ba4e68d 100644
--- a/src/tests/example_file.mdx
+++ b/src/tests/example_file.mdx
@@ -1,7 +0,0 @@
- {/* TODO: Hopefully this comment turns into a todo issue */}
- {/*
- TODO:Multiline comments
- also need to be turned into todos, and hopefully
- kept together as one todo
- */}
- - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.py b/tests/example_file.R diff --git a/tests/example_file.py b/tests/example_file.R
index 525e25d..ba4e68d 100644 index 525e25d..ba4e68d 100644
--- a/tests/example_file.R --- a/tests/example_file.R
@ -234,4 +258,4 @@ hello_world <- function() {
- # TODO: Do more stuff - # TODO: Do more stuff
- # This function should probably do something more interesting - # This function should probably do something more interesting
- # labels: help wanted - # labels: help wanted
}

View File

@ -232,6 +232,32 @@ index 0000000..7cccc5b
+ also need to be turned into todos, and hopefully + also need to be turned into todos, and hopefully
+ kept together as one todo + kept together as one todo
+ #} + #}
diff --git a/tests/example_file.md b/src/tests/example_file.md
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.md
@@ -0,0 +1,7 @@
+ {/* TODO: Hopefully this comment turns into a todo issue */}
+ {/*
+ TODO:Multiline comments
+ also need to be turned into todos, and hopefully
+ kept together as one todo
+ */}
+ - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.mdx b/src/tests/example_file.mdx
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.mdx
@@ -0,0 +1,7 @@
+ {/* TODO: Hopefully this comment turns into a todo issue */}
+ {/*
+ TODO:Multiline comments
+ also need to be turned into todos, and hopefully
+ kept together as one todo
+ */}
+ - [ ] TODO: An inline todo that's NOT a comment (what)
diff --git a/tests/example_file.py b/tests/example_file.R diff --git a/tests/example_file.py b/tests/example_file.R
new file mode 100644 new file mode 100644
index 0000000..525e25d index 0000000..525e25d

View File

@ -64,6 +64,9 @@ class NewIssueTests(unittest.TestCase):
def test_twig_issues(self): def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
def test_r_issues(self): def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)
@ -120,6 +123,9 @@ class ClosedIssueTests(unittest.TestCase):
def test_twig_issues(self): def test_twig_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'twig'), 2)
def test_md_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'markdown'), 6)
def test_r_issues(self): def test_r_issues(self):
self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2) self.assertEqual(count_issues_for_file_type(self.raw_issues, 'r'), 2)