Skip to content

Commit

Permalink
chore: fix precommit configs (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Jan 18, 2024
1 parent fe4c10a commit 6ce37da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
- id: ruff-format
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
entry: bash -c 'cd rust'
entry: bash -c 'cd rust && cargo fmt'
args: ['--verbose', '--']
6 changes: 3 additions & 3 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use chain::core::{Coordinate, Interval, Strand};
use chainfile as chain;
use pyo3::create_exception;
use pyo3::exceptions::{PyException, PyFileNotFoundError, PyKeyError, PyValueError};
use pyo3::exceptions::{PyException, PyFileNotFoundError, PyValueError};
use pyo3::prelude::*;
use std::fs::File;
use std::io::BufReader;
Expand All @@ -24,9 +24,9 @@ impl ChainLifter {
if !Path::new(&chainfile_path).exists() {
return Err(PyFileNotFoundError::new_err("Chainfile doesn't exist"));
}
let data = BufReader::new(File::open(&chainfile_path).unwrap());
let data = BufReader::new(File::open(chainfile_path).unwrap());
let reader = chain::Reader::new(data);
let machine = chain::liftover::machine::Builder::default()
let machine = chain::liftover::machine::Builder
.try_build_from(reader)
.unwrap();
Ok(ChainLifter { machine })
Expand Down

0 comments on commit 6ce37da

Please sign in to comment.