MATLAB Independent, Small & Safe, High Integrity Tools - code formatter and more
GPL-3.0 License
Bot releases are visible (Hide)
fcn
) which caused many duplicate itemsmh_trace
output. Now embedded functions use thePublished by florianschanda over 1 year ago
Published by florianschanda over 1 year ago
Published by florianschanda over 1 year ago
Add another method of tracing Simulink models via block
properties.
The top-level system of a Simulink Library (but not Model) no longer
appears in the tracing output, as there is no way to access or
manipulate this in the Simulink user interface.
Add new option --untagged-blocks-inherit-tags
for mh_trace
which
cases any untagged system to inherit any tags from its parent. Once
new tags are encountered this breaks the inheritence chain. Note
that embedded MATLAB blocks are unaffected by this option.
Published by florianschanda over 1 year ago
Fix issue where a Simulink model with self-contained links would not
parse the referenced systems. Only the top-level system would be
parsed and references were never followed.
Fix issue where a Simulink model with referenced stateflow would not
parse the referenced machines and charts.
Fix issue in mh_trace
where sometimes LOBSTER tags could be
generated which contained spaces.
Support multi-line and HTML annotations in Simulink for mh_trace
annotations.
Published by florianschanda over 1 year ago
Rework mh_trace
and its output format. It now generates LOBSTER
traces. See https://github.com/bmw-software-engineering/lobster for
more information, including a description of the interchange
format. The old output format is no longer supported now that there
is a good standard.
Add support for Simulink tracing in mh_trace
. You can add
annotations to any block starting with the text lobster-trace:
followed by a list of requirement tags. For example lobster-trace: foo.my_req
.
Remove mh_trace
commandline flag --json
and replace it with
--out-imp
and --out-act
. The default filename produced is now
mh_imp_trace.lobster
and mh_act_trace.lobster
.
Remove mh_trace
commandline flag --by-tag
. You can use a tool
like LOBSTER to recover this information.
Add mh_trace
commandline flag --only-tagged-blocks
. This filters
out all Simulink blocks that do not contain at least one tag.
Fix a bug in mh_trace
where precisely duplicated package +
function names result in only one tracable item. Now there are two,
and a tool like LOBSTER will complain.
Published by florianschanda almost 2 years ago
mh_trace
was not made available as amiss_hit
.Published by florianschanda about 2 years ago
You can now specify more precise Octave and MATLAB versions. This
change is massive, and likely to have subtle bugs. You can now write
octave: "4.4"
or matlab: "2020b"
in your config files; or specify
--octave=4.4
or --matlab=2020b
from the command-line. There is
also a special latest
version for both Octave and MATLAB, which is
an alias for the latest supported version.
This is also the first change that introduces backwards
incompatibility, specifically:
--octave
no longer works. You need to--octave=latest
to get the same behaviour.octave: true
still works, but isoctave: "latest"
.octave: false
doesn't make sense anymore (andAs always note that for MATLAB, support should be fairly good and
accurate. For Octave many things are missing (such as the end_X
set of keywords). I do plan to improve the situation, but please
create tickets for things you need sooner.
Several tools that generate messages (mh_style
, mh_metric
, and
mh_lint
) will now add the originating check id in the message. For
example:
In test.m, line 4
| false = 0.01; % bad
| ^^^^^ check (medium): redefining this builtin is very naughty [builtin_shadow]
This should make it much easier to disable rules if you don't like
to read the manual.
MISS_HIT now recognises and processes Octave test .tst
files
(along with .m
and .slx
files). The Octave test annotation
language (comments starting with %!
) is ignored by MH Style for
now. Thank you to Alois Spitzbart for the idea.
Published by florianschanda about 2 years ago
Published by florianschanda over 2 years ago
Add a new configuration option "indent_function_file_body" for MH
Style. This is true by default. If you set it to false, then you get
the odd indentation style that somewhat common in the MATLAB world,
where functions in function files do not have their body indented.
For example:
function z = Potato(w)
z = -w;
Note that this option only affects top-level functions in function
files. Any other function (e.g. a method, or a nested function) is
not affected.
Fix an issue where a broken symlink could cause the tools to crash
in some circumstances. Broken symlinks are now ignored.
Published by florianschanda over 2 years ago
[-.1 -~0]
which was-1.1
, instead of [-.1 -1]
. This could lead mh_style toPublished by florianschanda over 2 years ago
[CORRECTNESS] Fix a lexer bug where a matrix with a unary minus in
front did not correctly get interpreted as a separate element in
some cases. This could be seen in [1 -[1]]
which was seen as 0
,
instead of [1 -1]
. This could lead mh_style to change the meaning
of the code. This issue affected both matrices and cells.
In some cases configuration files could be parsed in a different
order on different platforms. This makes no practical difference,
except for some error messages that would be slightly differently
worded. This can be visible in the internal MISS_HIT testsuite. This
is now fixed.
Published by florianschanda almost 3 years ago
Fix a lexing/parsing bug in all tools where classes containing more
than one methods block, with a function named end
in one of the
blocks (but not the last one) would confuse the lexer in ending the
special treatment for words such as methods
prematurely. This
manifested in a confusing error message pointing at methods
stating that we expect methods
.
This is now fixed, and you can name functions end
again, no matter
where.
Published by florianschanda about 3 years ago
Support the !
and !=
operators in Octave mode. In Octave mode we
now also no longer parse !
as if it was a MATLAB shell escape.
Work around an extremely weird bug on some Windows envionments. The
behaviour of os.path.abspath could sometimes differ, leading to
weird problems like parsing the same config file twice (and then
complaining about duplicate definitions). One known environment is
using a Windows Python in a git bash environment, but there may be
others. This is now hopefully fixed in all such cases.
Published by florianschanda about 3 years ago
New command-line option for all tools (but only applicable for MH
Metric for now): --ignore-justifications-with-tickets
. This option
can be used to ignore all justifications that quote a ticket. The
idea here is that these would be temporary justifications (e.g. "to
be fixed in ABC-123"), and you might want to check from time to time
how much technical debt you have.
MH Lint now checks and enforces the correct syntax for TestTags.
Published by florianschanda about 3 years ago
matlab.unittest.TestCase
.Published by florianschanda about 3 years ago
All tools have a new common option --include-version
, which will
print the MISS_HIT version similar to --version
; but will continue
execution. This is helpful to debug e.g. CI issues.
MH_Trace supports a new pragma No_Tracing
, which can be used to
remove functions from the tracing output. This can be helpful if you
have e.g. a test driver or project initialisation code that is
neither product code or a test.
Published by florianschanda about 3 years ago
Support Octave identifiers in Octave mode. In Octave you can start
identifiers with an underscore, but you can't do it in MATLAB.
Additional information in tracing output produced by mh_trace
:
test
- True if the function is a unit test and false otherwise.shared
- Only present if you use project configuration. True ifMinor improvement for error messages on config files with syntax
errors: suggestions are offered now.
Published by florianschanda about 3 years ago
naming_parameters
would~
parameters. These will now always pass namePublished by florianschanda over 3 years ago
MH Trace can now produce tracing information from code. You can place
tracing tags in code using the new pragma Tag
:
%| pragma Tag("Potato");
MH Style and MH Copyright now support octave-style copyright notices
(i.e. Copyright (c) ...
instead of (c) Copyright ...
).
The default regular expression for matching copyright notices has
changed and must now include a new group. If you have configured
this setting, you must also include the new copy
group in your
regular expression, otherwise the tools break in interesting ways.
MH Style supports a new rule "naming_parameters" that enforces a
naming scheme for function and method inputs and outputs.
MH Style supports a new rule "naming_enumerations" that enforces a
naming scheme for class enumerations.
Fix various parsing corner cases in parsing extremely dubious
code. MISS_HIT previously rejected all of these as parse errors, now
it complains about (and fixes) the style instead:
A command-form invocation after a try
on the same line is now
correctly recognised: try rotate3d off; end
A global statement can be terminated by a comma or semicolon:
try, global dt, f = f*dt; end
A single quote directly after a keyword introduces a character
array: case'potato'
The expression in a for loop does not require any termination:
for i=1:indx(1)-1 y(i) = y(indx(1)); end
Fix parsing of Contents.m
in class directories (previously we
expected some code, but these files are supposed to be blank).
Fix a tool crash in MH Metrics: when producing the HTML report the
tool would crash if there were parse errors in at least one file.