Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Feature Enhancement: M-Lint Customization

Subject: Feature Enhancement: M-Lint Customization

From: Andy

Date: 13 May, 2011 15:06:02

Message: 1 of 4

I have submitted a feature enhancement requesting functionality that would allow the creation (via, e.g., regular expressions) of custom M-Lint warning/error messages. In addition, custom and included M-Lint messages should be editable both in the Preferences and programmatically. I can think of at least a few ways I would use this:, including:

- %TODO messages showing up as M-Lint messages (possibly with their own color)
- Suppressing "Input argument <name> may be unused" only for eventdata arguments in GUI m-files (i.e., for arguments which must be there, but are unused), while still keeping this warning for other arguments.
- Creating macros or shortcut buttons to toggle on and off individual messages, or to easily switch between settings. (I think the latter is already possible, but not with custom messages.)

So I ask the community:

1. Is part or all of this functionality currently available (and documented), and I'm just not seeing it for some reason?
2. How else might you use this functionality?
3. Is there some (probably undocumented) way we could implement this ourselves?

Subject: Feature Enhancement: M-Lint Customization

From: Steven_Lord

Date: 13 May, 2011 15:41:35

Message: 2 of 4



"Andy " <myfakeemailaddress@gmail.com> wrote in message
news:iqjhcq$9s7$1@newscl01ah.mathworks.com...
> I have submitted a feature enhancement requesting functionality that would
> allow the creation (via, e.g., regular expressions) of custom M-Lint
> warning/error messages. In addition, custom and included M-Lint messages
> should be editable both in the Preferences and programmatically. I can
> think of at least a few ways I would use this:, including:
>
> - %TODO messages showing up as M-Lint messages (possibly with their own
> color)
> - Suppressing "Input argument <name> may be unused" only for eventdata
> arguments in GUI m-files (i.e., for arguments which must be there, but are
> unused), while still keeping this warning for other arguments.
> - Creating macros or shortcut buttons to toggle on and off individual
> messages, or to easily switch between settings. (I think the latter is
> already possible, but not with custom messages.)
>
> So I ask the community:
>
> 1. Is part or all of this functionality currently available (and
> documented), and I'm just not seeing it for some reason?

Not exactly as you requested it, but the %TODO messages can be flagged by
the TODO/FIXME report:

http://www.mathworks.com/help/techdoc/matlab_env/f9-6232.html

and the unused input arguments can be replaced with a tilde to indicate to
MATLAB that they will not be used.

http://www.mathworks.com/help/techdoc/rn/br5fo8o-1.html#br65zmd-1

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Feature Enhancement: M-Lint Customization

From: Andy

Date: 13 May, 2011 15:57:04

Message: 3 of 4

"Steven_Lord" <slord@mathworks.com> wrote in message <iqjjff$gst$1@newscl01ah.mathworks.com>...
>
>
> "Andy " <myfakeemailaddress@gmail.com> wrote in message
> news:iqjhcq$9s7$1@newscl01ah.mathworks.com...
> > I have submitted a feature enhancement requesting functionality that would
> > allow the creation (via, e.g., regular expressions) of custom M-Lint
> > warning/error messages. In addition, custom and included M-Lint messages
> > should be editable both in the Preferences and programmatically. I can
> > think of at least a few ways I would use this:, including:
> >
> > - %TODO messages showing up as M-Lint messages (possibly with their own
> > color)
> > - Suppressing "Input argument <name> may be unused" only for eventdata
> > arguments in GUI m-files (i.e., for arguments which must be there, but are
> > unused), while still keeping this warning for other arguments.
> > - Creating macros or shortcut buttons to toggle on and off individual
> > messages, or to easily switch between settings. (I think the latter is
> > already possible, but not with custom messages.)
> >
> > So I ask the community:
> >
> > 1. Is part or all of this functionality currently available (and
> > documented), and I'm just not seeing it for some reason?
>
> Not exactly as you requested it, but the %TODO messages can be flagged by
> the TODO/FIXME report:
>
> http://www.mathworks.com/help/techdoc/matlab_env/f9-6232.html
>
> and the unused input arguments can be replaced with a tilde to indicate to
> MATLAB that they will not be used.
>
> http://www.mathworks.com/help/techdoc/rn/br5fo8o-1.html#br65zmd-1
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

I never use the TODO/FIXME report because it's in a separate file. It's faster for me to just Ctrl+F and search for %TODO. But it would be even better if it showed up in M-Lint. The warnings show orange and the errors show red in the bar on the right. If I could customize M-Lint so that %TODO shows blue, for example, then I could always see all of my TODOs at once and easily click on them to go to them.

As for the tilde, that must be a recent addition. It does not appear to work on R2009a.

Subject: Feature Enhancement: M-Lint Customization

From: Andy

Date: 13 May, 2011 22:37:02

Message: 4 of 4

"Andy" wrote in message <iqjkcg$k2n$1@newscl01ah.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <iqjjff$gst$1@newscl01ah.mathworks.com>...
> >
> >
> > "Andy " <myfakeemailaddress@gmail.com> wrote in message
> > news:iqjhcq$9s7$1@newscl01ah.mathworks.com...
> > > I have submitted a feature enhancement requesting functionality that would
> > > allow the creation (via, e.g., regular expressions) of custom M-Lint
> > > warning/error messages. In addition, custom and included M-Lint messages
> > > should be editable both in the Preferences and programmatically. I can
> > > think of at least a few ways I would use this:, including:
> > >
> > > - %TODO messages showing up as M-Lint messages (possibly with their own
> > > color)
> > > - Suppressing "Input argument <name> may be unused" only for eventdata
> > > arguments in GUI m-files (i.e., for arguments which must be there, but are
> > > unused), while still keeping this warning for other arguments.
> > > - Creating macros or shortcut buttons to toggle on and off individual
> > > messages, or to easily switch between settings. (I think the latter is
> > > already possible, but not with custom messages.)
> > >
> > > So I ask the community:
> > >
> > > 1. Is part or all of this functionality currently available (and
> > > documented), and I'm just not seeing it for some reason?
> >
> > Not exactly as you requested it, but the %TODO messages can be flagged by
> > the TODO/FIXME report:
> >
> > http://www.mathworks.com/help/techdoc/matlab_env/f9-6232.html
> >
> > and the unused input arguments can be replaced with a tilde to indicate to
> > MATLAB that they will not be used.
> >
> > http://www.mathworks.com/help/techdoc/rn/br5fo8o-1.html#br65zmd-1
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> > To contact Technical Support use the Contact Us link on
> > http://www.mathworks.com
>
> I never use the TODO/FIXME report because it's in a separate file. It's faster for me to just Ctrl+F and search for %TODO. But it would be even better if it showed up in M-Lint. The warnings show orange and the errors show red in the bar on the right. If I could customize M-Lint so that %TODO shows blue, for example, then I could always see all of my TODOs at once and easily click on them to go to them.
>
> As for the tilde, that must be a recent addition. It does not appear to work on R2009a.

I just tried out the tilde in R2010a, and it worked. Neat. Also, I thought of more uses for custom M-Lint messages:

- Weak enforcement (via warning messages) of function or variable names that don't follow the particular naming scheme that you've chosen to use for a given project. This would especially be helpful for beginners, but in large projects even experienced users can use some inconsistent naming schemes.

- Warning when variables in the same scope have names which differ only in capitalization.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us