Re: [libvirt-rust] change in coding style to follow rustfmt

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

 



On Wed, Jan 29, 2020 at 11:05:35AM +0100, Sahid Orentino Ferdjaoui wrote:
I'm proposing to merge a change [0] so the CI would check whether the
source code is well-formatted using rustfmt [1].

The aim is to add an easy convention to follow regarding the coding
style.

For contributors the natural thing to do before to submit any patches
is to verify the format using:

`cargo fmt -v -- --check`

The support of rustfmt via cargo can be added using:

`rustup component add rustfmt`

I did not want to pollute the mailing list with such big change which
doesn't bring anything.

Please let me know if you have any objections.


commit 851296786626d61ebec985a9caeb515514955dd8
Author: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@xxxxxxxxxxxxx>
Date:   Tue Jan 28 15:05:44 2020 +0100

   ensure that the code is well formatted using rustfmt.

   In this commit we add CI rule so travis would check whether the code
   is well formatted using rustfmt.

   Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@xxxxxxxxxxxxx>

.travis.yml               |    4 +

diff --git a/.travis.yml b/.travis.yml
index fc2c8f4..2e88aec 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,9 +39,13 @@ install:
   - sudo chmod a+rwx /var/run/libvirt/libvirt-sock*
   - echo "pass" | sudo saslpasswd2 -p -a libvirt user

+before_script:
+  - rustup component add rustfmt
+
 script:
+  - cargo fmt -v -- --check;

Why the semicolon at the end of this command?

   - cargo test --verbose
   # Due to an issue fixed in master we should not consider running
  # integration tests in parallel.
  # see: https://www.redhat.com/archives/libvir-list/2019-July/msg00287.html
  - cargo test --verbose -- --ignored --test-threads=1

Regardless,
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
to commit 851296786626d61ebec985a9caeb515514955dd8
(and all its hash collision that pass the CI :))

Jano

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux