Aaron Kutch 4 жил өмнө
parent
commit
d662521625

+ 16 - 2
.github/workflows/main.yml

@@ -109,6 +109,20 @@ jobs:
     - uses: actions/checkout@v1
       with:
         submodules: true
-    - name: Install Rust
-      run: rustup update stable && rustup default stable && rustup component add rustfmt
+    - name: Install stable `rustfmt`
+      run: rustup set profile minimal && rustup default stable && rustup component add rustfmt
     - run: cargo fmt -- --check
+
+  clippy:
+    name: Clippy
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v1
+      with:
+        submodules: true
+    # Unlike rustfmt, stable clippy does not work on code with nightly features.
+    # This acquires the most recent nightly with a clippy component.
+    - name: Install nightly `clippy`
+      run: |
+        rustup set profile minimal && rustup default "nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)" && rustup component add clippy
+    - run: cargo clippy -- -D clippy::all

+ 2 - 0
src/int/mod.rs

@@ -210,6 +210,8 @@ macro_rules! int_impl {
                 self
             }
 
+            // It makes writing macros easier if this is implemented for both signed and unsigned
+            #[allow(clippy::wrong_self_convention)]
             fn from_unsigned(me: $uty) -> Self {
                 me
             }