Skip to content

Commit

Permalink
#16: Add pre-push hook to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Artalus authored Feb 1, 2024
2 parents 90666e6 + d7fe8e8 commit 51267fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand All @@ -11,13 +12,23 @@ repos:
rev: v1.0
hooks:
- id: cargo-check
args: ["--color=always"]
- id: clippy
args: ["--color=always"]
- id: fmt
args: ["--", "--color=always"]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
hooks:
- id: check-github-workflows
args: ["--verbose"]
- repo: local
hooks:
- id: cargo-test
stages: [push]
name: cargo test
description: Run Rust tests.
entry: cargo test
language: system
types: [rust]
# cargo cannot test single files
pass_filenames: false
# no need to run multiple cargo's for multiple files
require_serial: true
2 changes: 1 addition & 1 deletion libmemoir/src/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub fn do_once() -> Result {
pub fn do_save(to: &String) -> Result {
let file = std::env::current_dir()
.context("Could not get current directory")?
.join(&to);
.join(to);
let parent = file.parent().unwrap();
let parentname = parent.as_os_str().to_os_string();
if !parent.exists() {
Expand Down

0 comments on commit 51267fd

Please sign in to comment.