Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
Add format check to action
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldple committed Sep 3, 2019
1 parent d8faca7 commit 7be9d6e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/rust.yml
Expand Up @@ -4,14 +4,13 @@ on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check Formatting
run: cargo fmt --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v1
- name: Check Formatting
run: cargo fmt -- --check
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Expand Up @@ -23,6 +23,7 @@ Code in this repository is held to a high standard, but don't let that put you o

These good practices are enforced by the following procedures:

- Continuous Integration is used to check that code is formatted correctly and all works as expected.
- All PRs will be reviewed by a maintainer. Here, suggestions will be made on how to improve the code until it is agreed that it is of the required standard.
- Bors will be used to merge all PRs. This ensures that the `master` branch is always green.
- Dependabot will ensure dependencies are kept up to date.
2 changes: 1 addition & 1 deletion bors.toml
@@ -1,3 +1,3 @@
status = ["continuous-integration/travis-ci/push"]
status = ["Build"]
pr-status = ["License Compliance", "WIP"]
delete-merged-branches = true
13 changes: 7 additions & 6 deletions src/date_tuple.rs
Expand Up @@ -241,11 +241,13 @@ impl DateTuple {
pub fn from_days(mut total_days: u32) -> Result<DateTuple, String> {
let mut years = 0u16;
let mut months = 1u8;
while total_days > if date_utils::is_leap_year(years) {
DAYS_IN_A_LEAP_YEAR
} else {
DAYS_IN_A_COMMON_YEAR
} {
while total_days
> if date_utils::is_leap_year(years) {
DAYS_IN_A_LEAP_YEAR
} else {
DAYS_IN_A_COMMON_YEAR
}
{
total_days -= if date_utils::is_leap_year(years) {
DAYS_IN_A_LEAP_YEAR
} else {
Expand Down Expand Up @@ -398,5 +400,4 @@ mod tests {
tuple4.previous_date()
);
}

}
1 change: 0 additions & 1 deletion src/month_tuple.rs
Expand Up @@ -248,5 +248,4 @@ mod tests {
let date = DateTuple::new(2000, 5, 10).unwrap();
assert_eq!(MonthTuple { y: 2000, m: 5 }, MonthTuple::from(date));
}

}
1 change: 0 additions & 1 deletion src/time_tuple.rs
Expand Up @@ -493,5 +493,4 @@ mod tests {
assert_eq!(58, tuple.m);
assert_eq!(59, tuple.s);
}

}

0 comments on commit 7be9d6e

Please sign in to comment.