mirror of
https://github.com/ratatui-org/ratatui
synced 2024-09-20 14:42:06 +00:00
[CI] Add lint stage
* Add scripts for Travis under ./scripts/travis * Install rustfmt and clippy on nightly * Lint code for formatting problems and common errors
This commit is contained in:
parent
b351ad86e4
commit
29db3dd722
4 changed files with 32 additions and 1 deletions
10
.travis.yml
10
.travis.yml
|
@ -1,9 +1,19 @@
|
|||
language: rust
|
||||
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
|
||||
cache: cargo
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- rust: nightly
|
||||
- rust: beta
|
||||
|
||||
before_script:
|
||||
- NO_RUSTUP=1 ./scripts/travis/before_script.sh
|
||||
|
||||
script:
|
||||
- NO_RUSTUP=1 ./scripts/travis/script.sh
|
||||
|
|
6
Makefile
6
Makefile
|
@ -11,7 +11,11 @@ RUSTUP_INSTALLED = $(shell command -v rustup 2> /dev/null)
|
|||
ifndef RUSTUP_INSTALLED
|
||||
CARGO = cargo
|
||||
else
|
||||
CARGO = rustup run $(RUST_CHANNEL) cargo
|
||||
ifdef NO_RUSTUP
|
||||
CARGO = cargo
|
||||
else
|
||||
CARGO = rustup run $(RUST_CHANNEL) cargo
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
|
8
scripts/travis/before_script.sh
Executable file
8
scripts/travis/before_script.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
export PATH="$PATH:$HOME/.cargo/bin"
|
||||
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
|
||||
make install
|
||||
fi
|
9
scripts/travis/script.sh
Executable file
9
scripts/travis/script.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
make build
|
||||
make test
|
||||
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
|
||||
make lint
|
||||
fi
|
Loading…
Reference in a new issue