miss_hit icon indicating copy to clipboard operation
miss_hit copied to clipboard

Invalid error for keyword `arguments`

Open pvogt09 opened this issue 10 months ago • 3 comments

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).

pvogt09 avatar Apr 24 '24 20:04 pvogt09

This one is going to be annoying to fix. I am looking into it.

florianschanda avatar Jul 08 '24 13:07 florianschanda

I looked into it. This one will be horrible to fix. How important is this one to you?

florianschanda avatar Aug 15 '24 11:08 florianschanda

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.

pvogt09 avatar Aug 22 '24 06:08 pvogt09