-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from CachedNerds/dev
Dev
- Loading branch information
Showing
74 changed files
with
4,158 additions
and
519 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cd "hatch" | ||
|
||
cargo build --verbose --all | ||
cargo test --verbose --all |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,45 @@ | ||
lanugage: rust | ||
sudo: required | ||
|
||
language: rust | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- libssl-dev | ||
|
||
cache: cargo | ||
|
||
rust: | ||
- stable | ||
- nightly | ||
|
||
# load travis-cargo | ||
before_script: | ||
- export PATH=$HOME/.cargo/bin:$PATH | ||
- cargo install cargo-update || echo "cargo-update already installed" | ||
- cargo install-update -a # update outdated cached binaries | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
script: | ||
- ./.ci_helper.sh | ||
- | | ||
cd hatch && | ||
cargo clean && | ||
cargo build && | ||
cargo test | ||
after_success: | ||
- | | ||
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then | ||
bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh) | ||
cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID; | ||
fi | ||
branches: | ||
# This is where pull requests from "bors r+" are built. | ||
- staging | ||
# This is where pull requests from "bors try" are built. | ||
- trying | ||
- dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<h1 align="center">Rust Style Guide</h1> | ||
|
||
*Please write good Rust.* | ||
|
||
## Table of Contents | ||
|
||
1. [Unsafe](#unsafe) | ||
2. [Whitespace](#whitespace) | ||
3. [Dereferences](#dereferences) | ||
4. [Use Statements](#use_statements) | ||
|
||
|
||
## Unsafe | ||
|
||
No use of the `unsafe` keyword is allowed. This guideline is statically enforced. | ||
|
||
## Whitespace | ||
|
||
All curly brace blocks will have at least one line return between the opening brace and the closing brace. The opening | ||
curly brace of keyword blocks (e.g. `impl`) will be placed on the same line as the keyword. | ||
|
||
##### Bad | ||
```rust | ||
impl Project { pub fn new() -> Project { ... } } | ||
``` | ||
|
||
##### Good | ||
```rust | ||
impl Project { | ||
pub fn new() -> Project { | ||
... | ||
} | ||
} | ||
``` | ||
|
||
All `else` and `else if` blocks will begin on the same line as the previous closing curly brace. | ||
|
||
##### Bad | ||
```rust | ||
if arg.is_present("bin") { ... } | ||
else if arg.is_present("static") { ... } | ||
else { ... } | ||
``` | ||
|
||
##### Good | ||
```rust | ||
if arg.is_present("bin") { | ||
... | ||
} else if arg.is_present("static") { | ||
... | ||
} else { | ||
... | ||
} | ||
``` | ||
|
||
## Dereferences | ||
|
||
When `y` is a reference, the asterisk operator used to _dereference_ `y` should | ||
contain no whitespace between the operator and the reference. | ||
|
||
##### Bad | ||
|
||
```rust | ||
match * y { | ||
... | ||
} | ||
``` | ||
|
||
##### Good | ||
|
||
```rust | ||
match *y { | ||
... | ||
} | ||
``` | ||
|
||
When `*y` is a reference the same styling as above should be used. | ||
|
||
## Use Statements | ||
|
||
When importing names from a module, only use the bracket notation when importing multiple names. | ||
|
||
##### Bad | ||
|
||
```rust | ||
use project::{ Project }; | ||
``` | ||
|
||
##### Good | ||
|
||
```rust | ||
use project::Project; | ||
use Foo::{ Bar, Baz }; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Appveyor configuration template for Rust using rustup for Rust installation | ||
# https://github.com/starkat99/appveyor-rust | ||
|
||
## Operating System (VM environment) ## | ||
|
||
# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets. | ||
os: Visual Studio 2015 | ||
|
||
## Build Matrix ## | ||
|
||
# This configuration will setup a build for each channel & target combination (12 windows | ||
# combinations in all). | ||
# | ||
# There are 3 channels: stable, beta, and nightly. | ||
# | ||
# Alternatively, the full version may be specified for the channel to build using that specific | ||
# version (e.g. channel: 1.5.0) | ||
# | ||
# The values for target are the set of windows Rust build targets. Each value is of the form | ||
# | ||
# ARCH-pc-windows-TOOLCHAIN | ||
# | ||
# Where ARCH is the target architecture, either x86_64 or i686, and TOOLCHAIN is the linker | ||
# toolchain to use, either msvc or gnu. See https://www.rust-lang.org/downloads.html#win-foot for | ||
# a description of the toolchain differences. | ||
# See https://github.com/rust-lang-nursery/rustup.rs/#toolchain-specification for description of | ||
# toolchains and host triples. | ||
# | ||
# Comment out channel/target combos you do not wish to build in CI. | ||
# | ||
# You may use the `cargoflags` and `RUSTFLAGS` variables to set additional flags for cargo commands | ||
# and rustc, respectively. For instance, you can uncomment the cargoflags lines in the nightly | ||
# channels to enable unstable features when building for nightly. Or you could add additional | ||
# matrix entries to test different combinations of features. | ||
environment: | ||
matrix: | ||
|
||
### MSVC Toolchains ### | ||
|
||
# Stable 64-bit MSVC | ||
- channel: stable | ||
target: x86_64-pc-windows-msvc | ||
|
||
## Install Script ## | ||
|
||
# This is the most important part of the Appveyor configuration. This installs the version of Rust | ||
# specified by the 'channel' and 'target' environment variables from the build matrix. This uses | ||
# rustup to install Rust. | ||
# | ||
# For simple configurations, instead of using the build matrix, you can simply set the | ||
# default-toolchain and default-host manually here. | ||
install: | ||
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe | ||
- rustup-init -yv --default-toolchain %channel% --default-host %target% | ||
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin | ||
- rustc -vV | ||
- cargo -vV | ||
|
||
## Build Script ## | ||
|
||
# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents | ||
# the "directory does not contain a project or solution file" error. | ||
build: false | ||
|
||
# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs | ||
#directly or perform other testing commands. Rust will automatically be placed in the PATH | ||
# environment variable. | ||
test_script: | ||
- .ci_helpers/appveyor_helper.bat |
Oops, something went wrong.