bugLaTeX semantic checker - Bugs: bug #60809, chktex warns about custom...

 
 

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

bug #60809: chktex warns about custom capitalized command

Submitter:  Raffi Khatchadourian <khatchad>
Submitted:  Mon 21 Jun 2021 06:21:01 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  gvol
Open/Closed:  Closed

Mon 10 Oct 2022 05:24:49 PM UTC, comment #4: 

comment #2:

> Actually, I saw that #60380 was basically the same request, so I added an option, CmdSpaceStyle, to be able to ignore warnings about spacing after a command.


Great. Looking forward to it.

Raffi Khatchadourian <khatchad>
Mon 10 Oct 2022 05:24:22 PM UTC, comment #3: 

comment #1:

> I'm not sure I understand what you want the behavior to be. Never warn if a command is at the end of a sentence?


Yes, because that command may expand to lowercase text.

> ChkTeX is a very simple program and doesn't actually understand what the definition of the macro is, so anything more complicated would be basically impossible.


Understood and agreed. What I am asking is for a suppression here.

> In fact, in this case it just looks at the last few characters to see that they are all uppercase and warns.


Right, but those characters aren't text, they are a command, which will expand to something else. Since it's not expanding the command, chktex can't tell whether or not the expanded text is capitalized. Thus, no warning should be ommited since it may be a false positive. I suppose you can argue that suppressing the warning could result in a false negative, but since command/macro expansion is out of the scope of the tool, I think that this is OK.

> Personally, I kind of like the fact that \USA and USA behave the same in this situation.  If gives me as the author a way to say that the macro returns upper case letters instead of lowercase and should warn here.


That makes sense, but the author may not even know what that macro expands to as it may be defined in a library.

>  ...
>
> The options I can see for you (none of them great):
> * Stop using upper case macros


Again, they may be defined in a library I cannot change.

> * Suppress the warning on every line you use one of these macros


That is what I am doing now, but it results in too many suppressions.

> ...
> * Turn off the warning entirely


I find the warning useful.

> ** Possibly creating a UserWarnRegex to better match the behavior you want.  If you get something that works well I'd be very interested in hearing about it.


I didn't consider that. Thanks for the suggestion, but I see that you added an option after all.

> ...
> Thanks for taking the time to file a bug!


Thanks for the response!

Raffi Khatchadourian <khatchad>
Fri 07 Oct 2022 12:44:32 AM UTC, comment #2: 

Actually, I saw that #60380 was basically the same request, so I added an option, CmdSpaceStyle, to be able to ignore warnings about spacing after a command.

Ivan Andrus <gvol>
Group administrator
Thu 06 Oct 2022 03:32:48 AM UTC, comment #1: 

I'm not sure I understand what you want the behavior to be. Never warn if a command is at the end of a sentence?  ChkTeX is a very simple program and doesn't actually understand what the definition of the macro is, so anything more complicated would be basically impossible.  In fact, in this case it just looks at the last few characters to see that they are all uppercase and warns.

Personally, I kind of like the fact that \USA and USA behave the same in this situation.  If gives me as the author a way to say that the macro returns upper case letters instead of lowercase and should warn here.  I realize that you might not use it that way though.

The options I can see for you (none of them great):

  • Stop using upper case macros
  • Suppress the warning on every line you use one of these macros
  • Live with the warnings
  • Turn off the warning entirely
    • Possibly creating a UserWarnRegex to better match the behavior you want.  If you get something that works well I'd be very interested in hearing about it.


So, I'm going to go close this, but feel free to reopen if you have an idea on how to make it work. 

Thanks for taking the time to file a bug!

Ivan Andrus <gvol>
Group administrator
Mon 21 Jun 2021 06:21:01 PM UTC, original submission:  

Sometimes I define capitalized commands, e.g., `\USA`. Using this command at the end of a sentence produces a ChkTeX warning about using intersentence spacing. How can I suppress this warning uniformly for such commands? Or, is this a bug such that it should automatically be suppressed?

See the [original post](https://tex.stackexchange.com/questions/601575/suppress-chktex-warning-about-custom-capitalized-command) for more info.

Raffi Khatchadourian <khatchad>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-06 gvol StatusNone Wont Fix
        Assigned toNone gvol
        Open/ClosedOpen Closed
    2021-06-21 khatchad Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code