[PATCH] Cleanup whitespace warnings in Lib.pm
--- perl/lib/Sys/Guestfs/Lib.pm | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index ba5aea6..8e20593 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -506,7 +506,7 @@ described in more detail below, but at the top level looks like: '/dev/VG/Root1' => \%os1, '/dev/VG/Root2' => \%os2, } - + %os1 = { os => 'linux', mounts => { @@ -792,7 +792,7 @@ sub _check_linux_root $r->{os_minor_version} = "$2" if(defined($2)); $r->{package_management} = "yum"; } - + elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux)/) { my $distro = $1; @@ -1051,7 +1051,7 @@ like: %oses = { '/dev/VG/Root' => \%os, } - + (There can be multiple roots for a multi-boot VM). The C<\%os> hash contains the following keys (any can be omitted): @@ -1701,7 +1701,7 @@ sub _inspect_initrd $initrd_modules = {}; $os->{initrd_modules} = $initrd_modules; } - + $initrd_modules->{$version} = \@modules; return \@modules; -- 1.6.2.5
On Mon, Aug 03, 2009 at 11:50:29AM +0100, Matthew Booth wrote:
---
ACK. Purely whitespace changes, or changes which fix typos, or add documentation shouldn't really need acking. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 11:50:29AM +0100, Matthew Booth wrote:
---
ACK. Purely whitespace changes, or changes which fix typos, or add documentation shouldn't really need acking.
How do you feel about a no-TABs-for-indentation rule? (like the one libvirt uses)
On Mon, Aug 03, 2009 at 02:59:37PM +0200, Jim Meyering wrote:
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 11:50:29AM +0100, Matthew Booth wrote:
---
ACK. Purely whitespace changes, or changes which fix typos, or add documentation shouldn't really need acking.
How do you feel about a no-TABs-for-indentation rule? (like the one libvirt uses)
Is there a once-and-for-all change I can make to .emacs to stop it from doing that? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 02:59:37PM +0200, Jim Meyering wrote:
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 11:50:29AM +0100, Matthew Booth wrote:
---
ACK. Purely whitespace changes, or changes which fix typos, or add documentation shouldn't really need acking.
How do you feel about a no-TABs-for-indentation rule? (like the one libvirt uses)
Is there a once-and-for-all change I can make to .emacs to stop it from doing that?
Sure. libvirt's HACKING has a tip I like: I'll be happy to extend it to other modes if that'd help, so it also affects ocaml, shell scripts, etc.: Code indentation ================ Libvirt's C source code generally adheres to some basic code-formatting conventions. The existing code base is not totally consistent on this front, but we do prefer that contributed code be formatted similarly. In short, use spaces-not-TABs for indentation, use 4 spaces for each indentation level, and other than that, follow the K&R style. If you use Emacs, add the following to one of one of your start-up files (e.g., ~/.emacs), to help ensure that you get indentation right: ;;; When editing C sources in libvirt, use this style. (defun libvirt-c-mode () "C mode with adjusted defaults for use with libvirt." (interactive) (c-set-style "K&R") (setq indent-tabs-mode nil) ; indent using spaces, not TABs (setq c-indent-level 4) (setq c-basic-offset 4)) (add-hook 'c-mode-hook '(lambda () (if (string-match "/libvirt" (buffer-file-name)) (libvirt-c-mode))))
On Mon, Aug 03, 2009 at 03:07:22PM +0200, Jim Meyering wrote:
Sure. libvirt's HACKING has a tip I like: I'll be happy to extend it to other modes if that'd help, so it also affects ocaml, shell scripts, etc.:
Code indentation ================ Libvirt's C source code generally adheres to some basic code-formatting conventions. The existing code base is not totally consistent on this front, but we do prefer that contributed code be formatted similarly. In short, use spaces-not-TABs for indentation, use 4 spaces for each indentation level, and other than that, follow the K&R style.
If you use Emacs, add the following to one of one of your start-up files (e.g., ~/.emacs), to help ensure that you get indentation right:
;;; When editing C sources in libvirt, use this style. (defun libvirt-c-mode () "C mode with adjusted defaults for use with libvirt." (interactive) (c-set-style "K&R") (setq indent-tabs-mode nil) ; indent using spaces, not TABs (setq c-indent-level 4) (setq c-basic-offset 4)) (add-hook 'c-mode-hook '(lambda () (if (string-match "/libvirt" (buffer-file-name)) (libvirt-c-mode))))
OK this seems sensible. Do you want to add it to our HACKING while you're doing the actual whitespace changes? Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 03:07:22PM +0200, Jim Meyering wrote:
Sure. libvirt's HACKING has a tip I like: I'll be happy to extend it to other modes if that'd help, so it also affects ocaml, shell scripts, etc.:
Code indentation ================ Libvirt's C source code generally adheres to some basic code-formatting conventions. The existing code base is not totally consistent on this front, but we do prefer that contributed code be formatted similarly. In short, use spaces-not-TABs for indentation, use 4 spaces for each indentation level, and other than that, follow the K&R style.
If you use Emacs, add the following to one of one of your start-up files (e.g., ~/.emacs), to help ensure that you get indentation right:
;;; When editing C sources in libvirt, use this style. (defun libvirt-c-mode () "C mode with adjusted defaults for use with libvirt." (interactive) (c-set-style "K&R") (setq indent-tabs-mode nil) ; indent using spaces, not TABs (setq c-indent-level 4) (setq c-basic-offset 4)) (add-hook 'c-mode-hook '(lambda () (if (string-match "/libvirt" (buffer-file-name)) (libvirt-c-mode))))
OK this seems sensible. Do you want to add it to our HACKING while you're doing the actual whitespace changes?
Will do.
On Mon, Aug 03, 2009 at 03:18:54PM +0200, Jim Meyering wrote:
Will do.
This is the snippet I've just tested: ---------------------------------------------------------------------- (defun libguestfs-c-mode () "C mode with adjusted defaults for use with libguestfs." (interactive) (setq indent-tabs-mode nil) ; indent using spaces, not TABs ) (add-hook 'c-mode-hook '(lambda () (if (string-match "/libguestfs" (buffer-file-name)) (libguestfs-c-mode)))) ---------------------------------------------------------------------- Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
On Mon, Aug 03, 2009 at 03:07:22PM +0200, Jim Meyering wrote:
(interactive) (c-set-style "K&R") (setq c-indent-level 4) (setq c-basic-offset 4))
... although these other defaults are horrible. Maybe just set indent-tabs-mode nil Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
On 03/08/09 13:59, Jim Meyering wrote:
Richard W.M. Jones wrote:
On Mon, Aug 03, 2009 at 11:50:29AM +0100, Matthew Booth wrote:
--- ACK. Purely whitespace changes, or changes which fix typos, or add documentation shouldn't really need acking.
How do you feel about a no-TABs-for-indentation rule? (like the one libvirt uses)
I have had 'set expandtab' in my .vimrc for years :) I would vote for this. Indentation with tabs sometimes breaks (e.g. if somebody has reconfigured tabs in their editor), whereas indentation with spaces never breaks. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (3)
-
Jim Meyering -
Matthew Booth -
Richard W.M. Jones