When test_proces_diff processes this file, it
fails to create the subdirectories, leading to
test failure. Since the subdirectories aren't
really needed, removing them allows the test
to complete successfully.
Updated number of expected passing tests to
account for the additional tests which can run
to completion now.
Provides a test for and the solution to GitHub
issue #242. Namely, an identifier which contains
regex characters (e.g. "[TODO]") is properly
handled by having the parser look for literal
"[" and "]" characters rather than treating those
characters as part of a regex pattern. The word
boundary regex pattern '\b' does NOT properly
handle this, so a slightly different pattern is
used to identify the boundary.
If TODO comment is a suffix to a line of
(executable) source, don't repeat the source
content when inserting the issue URL. But be sure
to still keep the same alignment.
Closes#229
Several related bugs that stem from a diff that
contains both deletions and additions. Specifically,
the line numbers aren't counted correctly, leading
to
- issue URL can't be inserted because it can't find
the right line in the latest file
- generated issue references the wrong line number
- closed issue references the wrong line number
See GitHub issue #236
The last item might not have any actual impact as
(I think) it's just informational. But it'd still
be better if it reported the correct line number
of the deletion, which necessarily has to be
relative to the _old_ file's line number, not the
updated file's.
As there is no solution in place yet for these
bugs, the unittest is marked as an expected failure
Added tests for issues #224/#225 and #229. Since
these are known bugs, the tests are currently
marked as expected failures. Once the solution
is implemented, that designation can be removed
and we'll still keep the test to make sure there
aren't any regressions.
Added a test which demonstrates a current bug where
if multiple TODOs with the same title appear in
the diff of the same file, only one of those issues
will have its URL succesfully inserted.
(Specifically, the first from the top.) As such,
the test is configured as an expected failure until
such time as the bug can be fixed.
The diff file has a couple of hunks which for
some unknown reason have parsing issues which
result in the wrong line being detected for where
the TODO is. This causes the issue URL insertion
to fail. That's its own issue that should be
investigated, but in order to allow the process_diff
unit test to pass, the diff file is being split
into two to isolate the trouble-causing hunks.
Insertion of the URL is different from simply
creating/updating the issue, so we want to have
this level of output to ensure that as many
file updates as expected are actually occurring.
Note: The unit test is currently failing!
Reads the diff file to generate a simulated
filesystem, inserts the URL comments into these
new files, and then parses the output to confirms
that all of the issues that were expected to be
created were created.
test_new.diff had some issues which would cause
errors if trying to actually use the diff file
with 'patch' to create the files it references.
1) had some line numbers which were invalid
2) had path specifications and, unfortunately,
'patch' does not support creating absent directories
The file has been cleaned up to have the create
line numbers and to assume that all files are at
the root.
Additionally, for the few cases where the diff
file referred to an edit rather than creation of a
whole new file, those diff hunks were moved into a
new, separate, file.
There is no functional change with this commit,
but it sets up future test features.
New unittest file consists of two tests. Both
run mypy, but one does so with arguments that are
expected to allow the test to pass. The other does
not provide those arguments and is expected to fail.
The expected failure is intentional, to serve as
an ongoing reminder to try to 1) move towards having
strict typing in the codebase and to 2) not
add any additional errors/warnings in the meantime.
Separated requirements into runtime (requirements.txt)
and additional development (requirements-dev.txt).
Modified devcontainer and workflow to reflect the
change.
CustomLanguageTest was modifying a few environment
variables and not restoring them when complete. This
led to problems for later tests that expected those
variables to be at their default values.