浏览代码

Merge #44

44: Check code style on CI r=almindor a=Disasm



Co-authored-by: Vadim Kaushan <admin@disasm.info>
bors[bot] 4 年之前
父节点
当前提交
174ef71651
共有 3 个文件被更改,包括 12 次插入0 次删除
  1. 4 0
      .travis.yml
  2. 4 0
      ci/install.sh
  3. 4 0
      ci/script.sh

+ 4 - 0
.travis.yml

@@ -28,6 +28,10 @@ matrix:
       language: bash
       if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
 
+    - env: RUSTFMT=1
+      rust: stable
+      if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
+
 
 install:
   - ci/install.sh

+ 4 - 0
ci/install.sh

@@ -12,3 +12,7 @@ if [ -n "${CHECK_BLOBS:-}" ]; then
         curl -L https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2018.12.0-x86_64-linux-ubuntu14.tar.gz | tar --strip-components=1 -C gcc -xz
     fi
 fi
+
+if [ -n "${RUSTFMT:-}" ]; then
+    rustup component add rustfmt
+fi

+ 4 - 0
ci/script.sh

@@ -14,3 +14,7 @@ if [ -n "${CHECK_BLOBS:-}" ]; then
     PATH="$PATH:$PWD/gcc/bin"
     ./check-blobs.sh
 fi
+
+if [ -n "${RUSTFMT:-}" ]; then
+    cargo fmt -- --check
+fi