Bug 1077555 - beaker-wizard generated template overwrites my preconfigured vim settings
Summary: beaker-wizard generated template overwrites my preconfigured vim settings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.16
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 0.16.2
Assignee: Amit Saha
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-18 08:56 UTC by Branislav Blaškovič
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1081323 (view as bug list)
Environment:
Last Closed: 2014-04-28 23:00:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Branislav Blaškovič 2014-03-18 08:56:03 UTC
Description of problem:
Beaker-wizard's generated runtest.sh template contains this:
  # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
this setting overwrite my dictionary settings. We should use dict+=/path/to/dict

Version-Release number of selected component (if applicable):
  beaker-client-0.16.0-1.fc19.noarch

How reproducible:
  always

Steps to Reproduce:
1. Define some dictionary in ~/.vimrc
2. Open runtest.sh generated by beaker-wizard
3. :set dictionary

Actual results:
  dictionary=/usr/share/beakerlib/dictionary.vim

Expected results:
 dictionary=/home/bblaskov/mydict,/usr/share/beakerlib/dictionary.vim

Additional info:
  Fix is really easy. Just change variable 'VimDictionary' on line 384 in file '/usr/lib/python2.7/site-packages/bkr/client/wizard.py'.
    VimDictionary = "# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k"

Comment 2 Amit Saha 2014-03-19 00:50:05 UTC
(In reply to Branislav Blaškovič from comment #0)
> Description of problem:
> Beaker-wizard's generated runtest.sh template contains this:
>   # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k

Can we just get rid of this? FWIW, the test creator may not even be a vim user. (I am not, for example).

Comment 3 Branislav Blaškovič 2014-03-19 08:19:08 UTC
Yes that would be solution too, imho.

Comment 4 Amit Saha 2014-03-20 00:43:59 UTC
http://gerrit.beaker-project.org/#/c/2938/

Comment 5 Dan Callaghan 2014-03-20 02:52:43 UTC
I'm on the fence about this. On the one hand, beaker-wizard is generating a skeleton for you -- that means, it's making some suggestions and if you don't like what it produced you just edit it as you please. In that sense, the vim modeline is a helpful suggestion (for example I didn't even know there was a custom spelling dictionary for beakerlib!) and I would rather keep it while making it as unintrusive as possible.

On the other hand, it makes sense for beaker-wizard to generate minimal output -- otherwise we could just jam more and more helpful suggestions in there until the skeleton is so big and unwieldy that it is not useful anymore.

Comment 6 Amit Saha 2014-03-21 00:04:41 UTC
(In reply to Dan Callaghan from comment #5)
> I'm on the fence about this. On the one hand, beaker-wizard is generating a
> skeleton for you -- that means, it's making some suggestions and if you
> don't like what it produced you just edit it as you please. In that sense,
> the vim modeline is a helpful suggestion (for example I didn't even know
> there was a custom spelling dictionary for beakerlib!) and I would rather
> keep it while making it as unintrusive as possible.

If one is a Vim user, yes, it's arguable that it is useful. If I am not, I can edit it out. We can live with it, but I don't think we should keep a feature which *may* benefit a certain percentage of the users, but be the source of bugs such as this.

Comment 7 Dan Callaghan 2014-03-21 01:47:10 UTC
But we can easily fix the modeline not to overwrite user dictionaries.

You can also submit a patch to add the emacs equivalent if the vim-centricness of it bothers you :-)

Comment 8 Amit Saha 2014-03-21 01:49:44 UTC
(In reply to Dan Callaghan from comment #7)
> But we can easily fix the modeline not to overwrite user dictionaries.

Sure, if that's the path we want to take.

> 
> You can also submit a patch to add the emacs equivalent if the
> vim-centricness of it bothers you :-)

No, that's not what is bothering me.

Comment 9 Branislav Blaškovič 2014-03-24 10:06:44 UTC
Well, do it as you think. Just fix it please ;)

Comment 10 Raymond Mancy 2014-03-25 02:41:52 UTC
(In reply to Dan Callaghan from comment #5)
> I'm on the fence about this. On the one hand, beaker-wizard is generating a
> skeleton for you -- that means, it's making some suggestions and if you
> don't like what it produced you just edit it as you please. 

The good thing about this skeleton generator, is that it asks you a lot of questions as well. It does not assume what your name is, it asks you to provide useful information to it.

Why not have it ask the question "Do you want to include vim headers?"
This way, we aren't throwing away useful tidbits, nor are we putting 'junk' into some peoples test files. Would that work?

Comment 11 Branislav Blaškovič 2014-03-25 09:21:34 UTC
(In reply to Raymond Mancy from comment #10)
> Why not have it ask the question "Do you want to include vim headers?"

If you do it like this, please include some argument to have it implicit, for example:
  beaker-wizard --vim -b 123456

Thank you

Comment 12 Amit Saha 2014-03-27 02:50:55 UTC
(In reply to Branislav Blaškovič from comment #0)
> Description of problem:
> Beaker-wizard's generated runtest.sh template contains this:
>   # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
> this setting overwrite my dictionary settings. We should use
> dict+=/path/to/dict
> 
> Version-Release number of selected component (if applicable):
>   beaker-client-0.16.0-1.fc19.noarch
> 
> How reproducible:
>   always
> 
> Steps to Reproduce:
> 1. Define some dictionary in ~/.vimrc
> 2. Open runtest.sh generated by beaker-wizard
> 3. :set dictionary
> 
> Actual results:
>   dictionary=/usr/share/beakerlib/dictionary.vim
> 
> Expected results:
>  dictionary=/home/bblaskov/mydict,/usr/share/beakerlib/dictionary.vim
> 
> Additional info:
>   Fix is really easy. Just change variable 'VimDictionary' on line 384 in
> file '/usr/lib/python2.7/site-packages/bkr/client/wizard.py'.
>     VimDictionary = "# vim: dict+=/usr/share/beakerlib/dictionary.vim
> cpt=.,w,b,u,t,i,k"

Patch: http://gerrit.beaker-project.org/#/c/2977/

Comment 13 Amit Saha 2014-03-27 03:01:42 UTC
(In reply to Raymond Mancy from comment #10)
> (In reply to Dan Callaghan from comment #5)
> > I'm on the fence about this. On the one hand, beaker-wizard is generating a
> > skeleton for you -- that means, it's making some suggestions and if you
> > don't like what it produced you just edit it as you please. 
> 
> The good thing about this skeleton generator, is that it asks you a lot of
> questions as well. It does not assume what your name is, it asks you to
> provide useful information to it.
> 
> Why not have it ask the question "Do you want to include vim headers?"
> This way, we aren't throwing away useful tidbits, nor are we putting 'junk'
> into some peoples test files. Would that work?

Added as a RFE: https://bugzilla.redhat.com/show_bug.cgi?id=1081323

Comment 18 Dan Callaghan 2014-04-28 23:00:36 UTC
Beaker 0.16.2 has been released.


Note You need to log in before you can comment on or make changes to this bug.