mbox

[bug#43261,0/2] lint: Fix 'no-network' and add 'no-checkers' options

Message ID 20200907180229.29475-1-zimon.toutoune@gmail.com
Headers show

Message

Simon Tournier Sept. 7, 2020, 6:02 p.m. UTC
Dear,

The first patch fixes the unexpected behaviour of "guix lint":

  guix lint -c description -n
           vs
  guix lint -n -c description

Now, if '--no-network' and any checkers are provided using '--checkers' then
the ones requiring Internet access are turned off.


The second patch adds the '--no-checkers' option discussed some time ago.  I
am not convinced by the 'option-checker' helper function.  What could be
better?

Instead of '--no-checkers' maybe '--exclude-checkers' is a better name.


Last, note that '--list-checkers' operates as a dry-run:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix lint -c description,formatting,synopsis -n -x description -l
Available checkers:
- formatting: Look for formatting issues in the source
--8<---------------cut here---------------end--------------->8---


All the best,
simon

zimoun (2):
  lint: Fix '--no-network' option.
  lint: Add '--no-checkers' option.

 doc/guix.texi         |  9 +++++++
 guix/scripts/lint.scm | 55 +++++++++++++++++++++++++++----------------
 2 files changed, 44 insertions(+), 20 deletions(-)


base-commit: 89e1e4481382d18033a9773b90c09345fa33d6cb

Comments

Efraim Flashner Sept. 8, 2020, 7:56 a.m. UTC | #1
On Mon, Sep 07, 2020 at 08:02:29PM +0200, zimoun wrote:
> Dear,
> 
> The first patch fixes the unexpected behaviour of "guix lint":
> 
>   guix lint -c description -n
>            vs
>   guix lint -n -c description
> 
> Now, if '--no-network' and any checkers are provided using '--checkers' then
> the ones requiring Internet access are turned off.
> 

I was going to say I didn't like the '-n' flag but I see it's already
there, just not documented in the help message.

> 
> The second patch adds the '--no-checkers' option discussed some time ago.  I
> am not convinced by the 'option-checker' helper function.  What could be
> better?
> 
> Instead of '--no-checkers' maybe '--exclude-checkers' is a better name.
> 

how about '--skip'

> 
> Last, note that '--list-checkers' operates as a dry-run:
> 
> --8<---------------cut here---------------start------------->8---
> ./pre-inst-env guix lint -c description,formatting,synopsis -n -x description -l
> Available checkers:
> - formatting: Look for formatting issues in the source
> --8<---------------cut here---------------end--------------->8---
> 
> 
> All the best,
> simon
> 
> zimoun (2):
>   lint: Fix '--no-network' option.
>   lint: Add '--no-checkers' option.
> 
>  doc/guix.texi         |  9 +++++++
>  guix/scripts/lint.scm | 55 +++++++++++++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 20 deletions(-)
> 
> 
> base-commit: 89e1e4481382d18033a9773b90c09345fa33d6cb
> -- 
> 2.28.0
> 
> 
> 
>
Simon Tournier Sept. 8, 2020, 9:16 a.m. UTC | #2
HI Efraim,

Thank you for the feedback.

On Tue, 8 Sep 2020 at 09:57, Efraim Flashner <efraim@flashner.co.il> wrote:

> I was going to say I didn't like the '-n' flag but I see it's already
> there, just not documented in the help message.

Me neither.  Since it is still undocumented, maybe we could change the
short name.  Well, I do not have a strong opinion.


> > The second patch adds the '--no-checkers' option discussed some time ago.  I
> > am not convinced by the 'option-checker' helper function.  What could be
> > better?
> >
> > Instead of '--no-checkers' maybe '--exclude-checkers' is a better name.
>
> how about '--skip'

With the short name  '-s' or still '-x' ?


Cheers,
simon
Simon Tournier Oct. 9, 2020, 8:39 p.m. UTC | #3
friendly ping

On Mon, 07 Sep 2020 at 20:02, zimoun <zimon.toutoune@gmail.com> wrote:
> Dear,
>
> The first patch fixes the unexpected behaviour of "guix lint":
>
>   guix lint -c description -n
>            vs
>   guix lint -n -c description
>
> Now, if '--no-network' and any checkers are provided using '--checkers' then
> the ones requiring Internet access are turned off.
>
>
> The second patch adds the '--no-checkers' option discussed some time ago.  I
> am not convinced by the 'option-checker' helper function.  What could be
> better?
>
> Instead of '--no-checkers' maybe '--exclude-checkers' is a better name.
>
>
> Last, note that '--list-checkers' operates as a dry-run:
>
> ./pre-inst-env guix lint -c description,formatting,synopsis -n -x description -l
> Available checkers:
> - formatting: Look for formatting issues in the source
>
>
> All the best,
> simon
>
> zimoun (2):
>   lint: Fix '--no-network' option.
>   lint: Add '--no-checkers' option.
>
>  doc/guix.texi         |  9 +++++++
>  guix/scripts/lint.scm | 55 +++++++++++++++++++++++++++----------------
>  2 files changed, 44 insertions(+), 20 deletions(-)
>
>
> base-commit: 89e1e4481382d18033a9773b90c09345fa33d6cb
Ludovic Courtès Oct. 28, 2020, 3:13 p.m. UTC | #4
Hi,

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Mon, Sep 07, 2020 at 08:02:29PM +0200, zimoun wrote:

[...]

>> The second patch adds the '--no-checkers' option discussed some time ago.  I
>> am not convinced by the 'option-checker' helper function.  What could be
>> better?
>> 
>> Instead of '--no-checkers' maybe '--exclude-checkers' is a better name.
>> 
>
> how about '--skip'

I’d suggest ‘--exclude’ + ‘-x’, which is similar to what ‘guix hash’
does for instance.

Ludo’.