bugLaTeX semantic checker - Bugs: bug #48137, Missed matches from UserWarnRegex

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #48137: Missed matches from UserWarnRegex

Submitted by:  Michael Orlitzky <mjo>
Submitted on:  Sun 05 Jun 2016 06:49:50 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: Ivan Andrus <gvol>
Open/Closed: Open

Sun 11 Sep 2016 12:00:39 AM UTC, comment #5:

Aha, I was missing the equal sign after WipeArg, thanks!

Michael Orlitzky <mjo>
Sat 10 Sep 2016 11:48:41 PM UTC, comment #4:

Since \ref is in the default chktexrc (hence probably in the system wide chktexrc), you'll have to overwrite WipeArg instead of just appending to it. Do that, simply use

WipeArg = { ... }

instead of

WipeArg { ... }

At least, that works for me.

Ivan Andrus <gvol>
Project AdministratorIn charge of this item.
Sat 10 Sep 2016 06:46:24 PM UTC, comment #3:

Thanks for taking a look. Even with \ref removed from \WipeArg, it acts a little weird. This still doesn't match anything,

UserWarnRegex
{
[Cc]orollary.\\ref.c
}

even though there are a bunch of "Corollary~\ref{cor:whatever}" in my document. The slightly more complicated rule, even with the curly brace escaped, doesn't work either (it generates false positives).

It's not critical to me though; I have a few "lint" tests as part of my makefile, and have been using grep (with empty expected output) to catch these.

Michael Orlitzky <mjo>
Sat 10 Sep 2016 05:28:08 AM UTC, comment #2:

It does mean that you have a work around, but removing \ref from WipeArg in your .chktexrc.

Ivan Andrus <gvol>
Project AdministratorIn charge of this item.
Sat 10 Sep 2016 05:27:01 AM UTC, comment #1:

Sorry for not replying sooner. For some reason I don't always get notified. It's very frustrating.

Anyway, { is a special character in a regex so you'll have to escape it. Sadly, for the second case, the regular expresions are run after WipeArg. It should be possible to run them before WipeArg, but I didn't want add all the complexity without a good use case. This might be one. See https://savannah.nongnu.org/bugs/?36949 for some more details.

Ivan Andrus <gvol>
Project AdministratorIn charge of this item.
Sun 05 Jun 2016 06:49:50 PM UTC, original submission:

I'm trying to catch references of the wrong type. For example, I label all of my propositions by \label{prop:some proposition}. (Note the "prop" prefix.) If I refer to that after the word "Proposition", then that's fine. But it should be an error to do something like Corollary~\ref{prop:some proposition}.

I'm trying to match this with a simple UserWarnRegex, but it's acting weird. If I have this in my chktexrc,

UserWarnRegex
{
[Cc]orollary.\\ref..
}

Then it successfully matches all references in my document. But if I change that last dot to a 'c', then it misses every match! Even though the dot matches a bunch of 'c' characters occurring in e.g. Corollary~\ref{cor:my corollary}.

So, this doesn't match anything:

UserWarnRegex
{
[Cc]orollary.\\ref.c
}

even though it should match such a Corollary reference. (That other dot should be a curly brace, but those make it act weird too...)

Ultimately, the expression that I would like to work is,

UserWarnRegex
{
[Cc]orollary.\\ref{[^c]
}

because that will catch "prop", "thm", "definition", etc.

Michael Orlitzky <mjo>

 

Attached Files
file #37398:  test.tex added by mjo (543B - application/x-tex - minimal test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gvol (Posted a comment)
  • -unavailable- added by mjo (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 Sep 2016 05:37:25 AM UTCgvolStatusNone=>Confirmed
    Sat 10 Sep 2016 05:27:01 AM UTCgvolAssigned toNone=>gvol
    Sun 05 Jun 2016 06:49:50 PM UTCmjoAttached File-=>Added test.tex, #37398

    Back to the top


    Powered by Savane 3.1-cleanup1