v0.2.0 - Initial annotation support
suve
released this
14 Oct 09:23
This version adds limited support for annotations.
It also introduces the 'fail-on' input,
allowing for "treat warnings as errors" behaviour.
Known issues that need resolving:
- FPC emits some errors, like "unexpected end of file",
with a line number of one past end of file.
For example, consider the following 4-line program:
1 Program hello_infinite;
2
3 Begin
4 Writeln('Oops, forgot to "End." the program!');
When you try to compile it, you'll get the following error:
hello.pas(5) Fatal: Unexpected end of file
GitHub ignores any annotations where the specified line number
exceeds the number of lines in the file. This could be fixed
by adding some extra logic for "column-less" diagnostics,
to make sure the line number doesn't go past end of file.
- FPC emits diagnostics using only the base name of the file.
For example, if you have a directory structure like this:
- main.pas
- units/my_unit.pas
Then a diagnostic for units/my_unit.pas will look like this:
my_unit.pas(20,5) Note: Local variable "Counter" not used
When the Action emits an annotation for "my_unit.pas", GitHub will
notice that the file doestn't exist, and ignore it.
This could be fixed by utilizing info output from FPC (i.e. '-vi'):
Compiling main.pas
Compiling /home/user/test/units/my_unit.pas
my_unit.pas(20,5) Note: Local variable "Counter" not used
Note how the "Compiling..." line contains the full path for
my_unit.pas - by converting it to a path relative to the working
directory, we could get the path of the file in the repository.
This would require making the parser stateful,
so caution is advised during implementation.
Extra issues which would be nice to get solved:
- FPC emits some messages which are most commonly ignored, e.g.:
- Warning: "crtbegin.o" not found, this will probably
cause a linking failure
- Warning: "crtend.o" not found, this will probably
cause a linking failure
These are common when building GUI programs. Some people may find them
useful, though, so ignoring these should be optional.
- FPC emits a Fatal when a file contains errors and end of file
is reached:
Fatal: There were 5 errors compiling module, stopping
We already create annotations for errors, and "5 errors found" is
redundant information either way, so this should be ignored.