1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Move clippy tests to stable

The clippy tests had to be run on nightly previously since it wasn't
available with the stable compiler yet, however this had the potential
to fail a lot since not all nightly builds offer clippy.

Since clippy is now available for stable rust, moving clippy to a stable
build should make sure that the failure rate of the CI job is cut down
to a minimum.

This fixes https://github.com/jwilm/alacritty/issues/2007.
This commit is contained in:
Christian Duerr 2019-01-23 22:04:45 +00:00 committed by GitHub
parent 3be51e6aea
commit 430b89c159
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 14 deletions

View file

@ -13,6 +13,7 @@ os:
rust: rust:
- stable - stable
- beta
- nightly - nightly
matrix: matrix:
@ -22,6 +23,18 @@ matrix:
os: linux os: linux
rust: stable rust: stable
env: ARCH=i386 env: ARCH=i386
- name: "Clippy Linux"
os: linux
env: CLIPPY=true
rust: stable
- name: "Clippy OSX"
os: osx
env: CLIPPY=true
rust: stable
- name: "Clippy Windows"
os: windows
env: CLIPPY=true
rust: stable
allow_failures: allow_failures:
- rust: nightly - rust: nightly

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Add clippy for linting with nightly builds # Add clippy for linting with nightly builds
if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then if [ "$CLIPPY" == "true" ]; then
rustup component add clippy-preview rustup component add clippy
fi fi

View file

@ -3,9 +3,10 @@
# Check if any command failed # Check if any command failed
error=false error=false
# Run clippy on nightly builds # Run clippy checks
if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then if [ "$CLIPPY" == "true" ]; then
cargo clippy --all-features --all-targets || error=true cargo clippy --all-targets
exit
fi fi
# Run test in release mode if a tag is present, to produce an optimized binary # Run test in release mode if a tag is present, to produce an optimized binary

View file

@ -47,7 +47,6 @@ macro_rules! bindings {
mode: _mode, mode: _mode,
notmode: _notmode, notmode: _notmode,
action: $action, action: $action,
..Default::default()
}); });
)* )*

View file

@ -137,7 +137,7 @@ impl log::Log for Logger {
record.file().unwrap_or("?"), record.file().unwrap_or("?"),
record.line() record.line()
.map(|l| l.to_string()) .map(|l| l.to_string())
.unwrap_or("?".to_string()), .unwrap_or_else(|| "?".into()),
record.args()) record.args())
} else { } else {
format!("[{}] [{}] {}\n", format!("[{}] [{}] {}\n",

View file

@ -208,7 +208,7 @@ impl Write for EventedWritablePipe {
impl<'a> OnResize for PtyHandle<'a> { impl<'a> OnResize for PtyHandle<'a> {
fn on_resize(&mut self, sizeinfo: &SizeInfo) { fn on_resize(&mut self, sizeinfo: &SizeInfo) {
match self { match self {
PtyHandle::Winpty(w) => w.winpty_mut().on_resize(sizeinfo), PtyHandle::Winpty(w) => w.resize(sizeinfo),
PtyHandle::Conpty(c) => { PtyHandle::Conpty(c) => {
let mut handle = c.clone(); let mut handle = c.clone();
handle.on_resize(sizeinfo) handle.on_resize(sizeinfo)

View file

@ -55,14 +55,14 @@ impl<'a> Agent<'a> {
/// Get immutable access to Winpty. /// Get immutable access to Winpty.
pub fn winpty(&self) -> &Winpty<'a> { pub fn winpty(&self) -> &Winpty<'a> {
unsafe {&*self.winpty} unsafe { &*self.winpty }
} }
/// Get mutable access to Winpty. pub fn resize(&self, size: &SizeInfo) {
/// Can offer internal mutability like this because Winpty uses // This is safe since Winpty uses a mutex internally.
/// a mutex internally. unsafe {
pub fn winpty_mut(&self) -> &mut Winpty<'a> { (&mut *self.winpty).on_resize(size);
unsafe {&mut *self.winpty} }
} }
} }