Skip to content

Commit

Permalink
Merge pull request #96 from qwinters/master
Browse files Browse the repository at this point in the history
Fix LaTeX bug + add tests
  • Loading branch information
alstr authored Dec 16, 2021
2 parents 283da1a + 4dca8a2 commit fa33680
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 13 deletions.
142 changes: 142 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
### https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/


10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ There are additional inputs if you want to be able to assign issues to projects.
* Vue
* YAML

New languages can easily be added to the `syntax.json` file used by the action to identify TODO comments. When adding languages, follow the structure of existing entries, and use the language name defined by GitHub in [`languages.yml`](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml). PRs adding new languages are welcome and appreciated.
New languages can easily be added to the `syntax.json` file used by the action to identify TODO comments. When adding languages, follow the structure of existing entries, and use the language name defined by GitHub in [`languages.yml`](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml). PRs adding new languages are welcome and appreciated. Please add a test for your language in order for your PR to be accepted.

## TODO Options

Expand Down Expand Up @@ -173,6 +173,14 @@ Issues are created whenever the action runs and finds a newly added TODO in the

If you do encounter any problems, please file an issue or submit a PR. Everyone is welcome and encouraged to contribute.


## Running tests locally

To run the tests locally, simply run the following in the main repo:
```shell
python -m unittest
```

## Thanks

The action was developed for the GitHub Hackathon. Whilst every effort is made to ensure it works, it comes with no guarantee.
Expand Down
4 changes: 2 additions & 2 deletions syntax.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@
{
"type": "block",
"pattern": {
"start": "\\begin{comment}",
"end": "\\end{comment}"
"start": "\\\\begin{comment}",
"end": "\\\\end{comment}"
}
}
]
Expand Down
Empty file added tests/__init__.py
Empty file.
63 changes: 62 additions & 1 deletion tests/test_closed.diff
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,65 @@ index 6397789..494d42f 100644
+++ b/src/tests/example_file.sql
@@ -1,2 +0,0 @@
--- TODO Select all:
-SELECT * FROM Products;
-SELECT * FROM Products;
diff --git a/tests/example_file.tex b/src/tests/example_file.tex
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.tex
@@ -0,0 +1,2 @@
-% TODO Add in preamble details
-\begin{document}
- \begin{comment}
- TODO This document needs content
- label: urgent
- \end{comment}
-\end{document}
diff --git a/tests/example_file.jl b/src/tests/example_file.jl
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.jl
@@ -0,0 +1,2 @@
- # TODO: Hopefully this comment turns into an issue
- print("Hello World")
- #= TODO: Multiline comments
- also need to be turned into task, and hopefully
- kept together as one.
- =#
diff --git a/tests/example_file.ahk b/src/tests/example_file.ahk
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.ahk
@@ -0,0 +1,2 @@
- ; TODO: Find a better way to manage hotkeys
- ; Maybe just switch to vim??
- #h::
- RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
diff --git a/tests/example_file.hbs b/src/tests/example_file.hbs
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.hbs
@@ -0,0 +1,2 @@
- <!-- TODO: Hopefully this comment turns into a todo issue -->
- {{!
- TODO: Make a handlebar templtate
- This is really just a test, but hopefully this works~!
- }}
diff --git a/tests/example_file.org b/src/tests/example_file.org
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.org
@@ -0,0 +1,2 @@
- # TODO: Hopefully this comment turns into a todo issue
- #+begin_src python
- print("Hello World")
- #+end_src
- + #+begin_comment
- TODO: Multiline comments
- also need to be turned into todos, and hopefully
- kept together as one todo
- #+end_comment
65 changes: 64 additions & 1 deletion tests/test_new.diff
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,67 @@ index 0000000..7cccc5b
+++ b/src/tests/example_file.sql
@@ -0,0 +1,2 @@
+-- TODO Select all:
+SELECT * FROM Products;
+SELECT * FROM Products;
diff --git a/tests/example_file.tex b/src/tests/example_file.tex
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.tex
@@ -0,0 +1,2 @@
+% TODO Add in preamble details
+\begin{document}
+ \begin{comment}
+ TODO This document needs content
+ label: urgent
+ \end{comment}
+\end{document}
diff --git a/tests/example_file.jl b/src/tests/example_file.jl
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.jl
@@ -0,0 +1,2 @@
+ # TODO: Hopefully this comment turns into an issue
+ print("Hello World")
+ #= TODO: Multiline comments
+ also need to be turned into task, and hopefully
+ kept together as one.
+ =#
diff --git a/tests/example_file.ahk b/src/tests/example_file.ahk
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.ahk
@@ -0,0 +1,2 @@
+ ; TODO: Find a better way to manage hotkeys
+ ; Maybe just switch to vim??
+ #h::
+ RegRead, HiddenFiles_Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
diff --git a/tests/example_file.hbs b/src/tests/example_file.hbs
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.hbs
@@ -0,0 +1,2 @@
+ <!-- TODO: Hopefully this comment turns into a todo issue -->
+ {{!
+ TODO: Make a handlebar templtate
+ This is really just a test, but hopefully this works~!
+ }}
diff --git a/tests/example_file.org b/src/tests/example_file.org
new file mode 100644
index 0000000..7cccc5b
--- /dev/null
+++ b/src/tests/example_file.org
@@ -0,0 +1,2 @@
+ # TODO: Hopefully this comment turns into a todo issue
+ #+begin_src python
+ print("Hello World")
+ #+end_src
+ #+begin_comment
+ TODO: Multiline comments
+ also need to be turned into todos, and hopefully
+ kept together as one todo
+ #+end_comment


Loading

0 comments on commit fa33680

Please sign in to comment.