bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lint options


From: arnold
Subject: Re: Lint options
Date: Fri, 30 Apr 2021 03:05:20 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

Thanks for the note.

James Ghofulpo <james@ghofulpo.com> wrote:

> Would it be possible to add options to gawk lint?  There are many things
> that I do intentionally that lint catches which are not errors:

I am happy to consider patches. Be aware that you will have to sign
paperwork assigning copyright in your changes to the FSF. The manual
in Appendix C provides guidelines to follow when making changes.

You will also need to provide documentation updates, not just code
updates.

And, of course, additional tests in the test suite.

See also the gawkworkflow.texi document.

> The backslash is ugly (not sure why the parser needs it)

It doesn't. Newlines are allowed after commas.

> but when I have lots of shadow variables, they don't all fit on one line.
> Could do a weird construction like:
>
> function xxx( param1, param2 )
>     ( shadow1, shadow2 )
> {
> }
>
> or
>
> function xxx( param1, param2 )
> {
>     var shadow1;
>     var shadow2;
>
> I'd prefer the last method; even though it's adding a new keyword, it's
> explicitly saying what's going on.

I'm afraid I'm not interested in changing the language to support
either of these constructs.  The grammar is already convoluted enough
as it is.  You are, of course, welcome to make such a change in
a personal version.

I generally do

        function xxx(p1, p2, p3,        # parameters
                     l1, l2, l3)        3 locals
        {
                ...
        }

which is pretty legible. (Of course, I use real names.)

> - Function defined but never called directly.  I have libraries of gawk
> functions, many of which aren't called from scripts.  Maybe lint should
> ignore these errors if the functions are being included in a library?

Changes for something like:

    --lint=no-uncalled-funcs,no-shadowed,no-extensions,...

would be reviewed and maybe accepted.

> - Warnings about gawk extension.  Maybe something like:
>
> @requires 5.0.1
>
> That way, it'll fail nicely.

I am not sure about something like that. Do you mean that if a
version of gawk is less than what's in @requires the whole program
would fail? Or just that --lint would not complain?

> Should I look into cloning the repository and adding the features myself?

You can always do this, no matter what. It's Free Software and that's
one of the most important Freedoms.

> If this is going to Arnold Robbins, please know that I am a fan of what
> you've done to the gawk community!

Thank you.

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]