Skip to content

Commit

Permalink
Re-enable rustfmt and clippy in Travis builds (#53)
Browse files Browse the repository at this point in the history
* Re-enable rustfmt and clippy in Travis builds

* Monkey with travis.yml

* Monkey with .travis.yml more

* More travis

* Monkey travis again
  • Loading branch information
paholg authored Aug 13, 2018
1 parent b0df3f2 commit a57d3d2
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 18 deletions.
25 changes: 13 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ notifications:
matrix:
include:
- rust: stable
before_script:
- rustup component add rustfmt-preview
script: |
cargo build &&
cargo test --features "test" &&
cargo fmt --version
cargo fmt --all -- --check
cargo build
cargo test --features "test"
cargo doc
include:
after_success: |
test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && cargo publish --token ${CRATESIO_TOKEN}
- rust: beta
script: |
cargo build &&
cargo test --features "test" &&
include:
cargo build
cargo test --features "test"
- rust: nightly
before_script:
- rustup component add rustfmt-preview
- rustup component add clippy-preview
script: |
cargo clippy --version
cargo clippy
cargo test --no-default-features --features ci
cargo test --all-features
after_success:
- test $TRAVIS_PULL_REQUEST == "false" &&
test $TRAVIS_BRANCH == "master" &&
cargo publish --token ${CRATESIO_TOKEN}

env:
global:
- secure: ZKVATaNNGsoAdISoshGxDt82Ie4lgbrn91cRK+hjQvtAJjlWva554l49P5RU6T4ZkGFC2PyQ/zF8jMmNsPJUeQ3F2E4v1NVw83CrSoqIRmtDzN6kgblshPAZVX8xNsEZarEV+dw+CTA7a5c0J0Nm38lIaxwuntvO47x8Zf0RFZc=
Expand Down
2 changes: 1 addition & 1 deletion src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! Consider this module **unstable**.
use typenum::{ATerm, Add1, Integer, Len, Length, TArr, Unsigned, B1, U0};
use typenum::{ATerm, Add1, B1, Integer, Len, Length, TArr, U0, Unsigned};

use generic_array::{ArrayLength, GenericArray};

Expand Down
3 changes: 1 addition & 2 deletions src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ more information.
*/
pub mod unit_systems {"#
.as_bytes(),
pub mod unit_systems {"#.as_bytes(),
).unwrap();

for s in &systems {
Expand Down
6 changes: 3 additions & 3 deletions src/build/si.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Where experimental values are used for constants, the values are obtained from t
EV: Joule = E.value_unsafe * V.value_unsafe, "Electronvolt";
U: Kilogram = 1.660539040e-27 * KG.value_unsafe, "Unified atomic mass unit; dalton";

C0: MeterPerSecond = 299792458.0 * MPS.value_unsafe, "Speed of light in a vacuum";
C0: MeterPerSecond = 299_792_458.0 * MPS.value_unsafe, "Speed of light in a vacuum";

HBAR: JouleSecond = 1.054571800e-34 * JS.value_unsafe, "Reduced Planck constant";
M_E: Kilogram = 9.10938356e-31 * KG.value_unsafe, "Electron mass";
Expand All @@ -168,7 +168,7 @@ Where experimental values are used for constants, the values are obtained from t
BARN: Meter2 = 1e-28 * M2.value_unsafe, "Barn";
BAR: Pascal = 1e5 * PA.value_unsafe, "Bar";
MBAR: Pascal = 100.0 * PA.value_unsafe, "Millibar";
ATM: Pascal = 101325.0 * PA.value_unsafe, "Atmosphere";
ATM: Pascal = 101_325.0 * PA.value_unsafe, "Atmosphere";
BA: Pascal = 0.1 * PA.value_unsafe, "Barye";
MMHG: Pascal = 133.322387415 * PA.value_unsafe, "Millimeter of mercury";
TORR: Pascal = ATM.value_unsafe / 760.0, "Torr";
Expand All @@ -178,7 +178,7 @@ Where experimental values are used for constants, the values are obtained from t
FT: Meter = 0.3048 * M.value_unsafe, "Foot";
IN: Meter = FT.value_unsafe / 12.0, "Inch";
YD: Meter = 3.0 * FT.value_unsafe, "Yard";
MI: Meter = 5280.0 * FT.value_unsafe, "Mile";
MI: Meter = 5_280.0 * FT.value_unsafe, "Mile";

LB: Kilogram = 0.45359237 * KG.value_unsafe, "Pound mass";
OZ: Kilogram = LB.value_unsafe / 16.0, "Ounce";
Expand Down
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ crate. Pretty much everything else is for ergonomics.
#![cfg_attr(not(feature = "std"), feature(core_intrinsics, extern_prelude))]
#![cfg_attr(feature = "oibit", feature(optin_builtin_traits))]
#![cfg_attr(feature = "spec", feature(specialization))]
#![cfg_attr(feature = "cargo-clippy", allow(
// Don't think we'll ever be able to remove this.
type_complexity,
// Not great. See issue #52.
transmute_ptr_to_ptr,
// These are output from the build macros; if we could get output integers to include
// underscores, we could remove it.
unreadable_literal,
// This is fine; we have constants defined as f32 and f64, so excessive precition for f32 is
// good.
excessive_precision,
))]

// Get a warning without this.
#[allow(unused_imports)]
Expand Down
1 change: 1 addition & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ macro_rules! impl_root {
type Output = $t;

fn root(self, _: Index) -> Self::Output {
#[allow(cast_lossless)]
let exp = (Index::to_i32() as $t).recip();
#[cfg(feature = "std")]
return self.powf(exp);
Expand Down

0 comments on commit a57d3d2

Please sign in to comment.