[m-rev.] for post-commit review: --limit-error-contexts

Zoltan Somogyi zoltan.somogyi at runbox.com
Wed Feb 4 17:46:57 AEDT 2015



On Wed, 4 Feb 2015 15:02:57 +1100, Peter Wang <novalazy at gmail.com> wrote:

> On Wed, 4 Feb 2015 12:39:11 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
> > 
> > On Tue, 3 Feb 2015, Zoltan Somogyi wrote:
> > 
> > > I found the need for this when working on rewriting modules.m
> > > for the new item structure.
> > >
> > > The diff itself is quite straightforward. The question I would like
> > > feedback on is: do people think this is a generally useful option
> > > that should be documented for use by non-developers?
> > 
> > I think so -- it's not just (Mercury) developers who need to work on
> > sections of large files.
> 
> I've not wanted such a feature myself.

I have rarely wanted it myself, but I can tell you from experience,
when you want it, you want it bad. (Working on lines 1900-2100 of
modules.m while changing the item list representation, having
to ignore 400 of the 500 lines of error messages before you get
to the ones about the lines you are working on now gets real tedious,
real fast.)

Most of the time, you don't get that many error messages at once,
and when you do, it usually doesn't matter which ones you start
addressing first, so you can pick the first ones. In this case,
neither is really true.

BTW, so far I have discovered FOUR semantically distinct things
that the old item list structure was representing :-(

> Perhaps there should be a warning about suppressed messages if there
> isn't one.  You (rather, I) might forget that a limit has been set,
> leading to unnecessary frustration.

Good idea.

> Contexts are associated with files and not modules, but would it be
> possible to reuse the generic way of limiting options to modules:
> 
>     MCFLAGS-mod += --limit-error-contexts min-max,min-max
> 
> That would reduce the amount of syntax peculiar to this option.

I will make the filename part optional, for use in cases like this.

> Otherwise, the file:range syntax should treat everything up to the
> rightmost colon as the path.  Granted, colons should be avoided for
> other reasons.  On Windows, mmc -f may be used with absolute paths
> and those can contain ':' for the drive.

OK, will do that.

> +%       "\tPrint errors and warning for the named file only when their",
> +%       "\tline number is in one of the specified ranges.",
> 
> warnings
> 
> +%       "\tEither the minimum or the maximum line number in the range",
> +%       "\tmay be missing, in which case the range has no lower or upper",
> +%       "\tlimit respectively.",
> 
> The minimum or maximum line number in each range may be omitted,
> in which case the range has no lower or upper bound respectively.

Thanks for that. I will make the changes suggested above later today.

Zoltan.





More information about the reviews mailing list