Skip to content

Commit

Permalink
Merge pull request #102 from CachedNerds/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
technetos authored Feb 19, 2018
2 parents 67a1fe6 + baa7494 commit 6be7806
Showing 74 changed files with 4,158 additions and 519 deletions.
9 changes: 0 additions & 9 deletions .ci_helper.sh

This file was deleted.

4 changes: 4 additions & 0 deletions .ci_helpers/appveyor_helper.bat
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 added .coveralls.yml
Empty file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
40 changes: 38 additions & 2 deletions .travis.yml
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,12 +3,35 @@
<h1 align="center">Hatch</h1>
<p align="center">The project manager for CachedNerds/Toolbox et;al</p>

<p align="center"><a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/github/license/CachedNerds/Hatch.svg"></a></p>

<div align="center">
<table>
<tr>
<th >Master</th>
<th align="center"><a href="https://travis-ci.org/CachedNerds/Hatch"><img src="https://travis-ci.org/CachedNerds/Hatch.svg?branch=master"></a></th>
<th align="center"><a href="https://ci.appveyor.com/project/DannyPeck/hatch/branch/master"><img src="https://ci.appveyor.com/api/projects/status/ca0p5xwqjva7w6b2/branch/master?svg=true"></a></th>
<th align="center"><a href="https://coveralls.io/repos/github/CachedNerds/Hatch/badge.svg?branch=master"><img src="https://coveralls.io/repos/github/CachedNerds/Hatch/badge.svg?branch=master"></a></th>
</tr>
<tr bgcolor="#fff">
<th >Dev</a></th>
<th align="center"><a href="https://travis-ci.org/CachedNerds/Hatch"><img src="https://travis-ci.org/CachedNerds/Hatch.svg?branch=dev"></a></th>
<th align="center"><a href="https://ci.appveyor.com/api/projects/status/ca0p5xwqjva7w6b2/branch/dev?svg=true"><img src="https://ci.appveyor.com/api/projects/status/ca0p5xwqjva7w6b2/branch/dev?svg=true"></a></th>
<th align="center"><a href="https://coveralls.io/repos/github/CachedNerds/Hatch/badge.svg?branch=dev"><img src="https://coveralls.io/repos/github/CachedNerds/Hatch/badge.svg?branch=dev"></a></th>
</tr>
</table>
</div>

# [Workflow Standards](https://github.com/CachedNerds/Hatch/blob/master/WORKFLOW.md)

# Usage

# Technologies

# Contributing

Please follow the [Style Guide](STYLE.md) when contributing.

# Code of conduct

# License
94 changes: 94 additions & 0 deletions STYLE.md
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 };
```
69 changes: 69 additions & 0 deletions appveyor.yml
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
Loading

0 comments on commit 6be7806

Please sign in to comment.