miss_hit
miss_hit copied to clipboard
Invalid error for keyword `arguments`
MISS_HIT Component affected Please choose one from:
- Style checker
Your MATLAB/Octave environment
- MATLAB
- R2023B
Your operating system and Python version
- Linux
- python 3.8.10
Describe the bug The file
function [] = test()
a = 0;
arguments = struct(...
'test', 1.0...
);
end
gives the error
In arguments.m, line 3
| arguments = struct(...
| ^^^^^^^^^ error: expected valid statement, found keyword 'arguments' instead
MISS_HIT Style Summary: 1 file(s) analysed, 1 error(s)
which should not be the case because it is allowed to have variables called arguments
as long as the keyword does not appear as the first expression in the function body (a = 0;
makes the difference here between invalid Matlab syntax and correct code).
This one is going to be annoying to fix. I am looking into it.
I looked into it. This one will be horrible to fix. How important is this one to you?
Since there is a workaround and it can be prevented by simply using a different variable name, the priority is not too high. If you want to prioritize something, it would be https://github.com/florianschanda/miss_hit/issues/287, because there does not seem to be a workaround and it is currently blocking me from using miss_hit
as commit hook because there are many uses of class attributes that do not comply the naming schema.