mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
Updates for new rustfmt
This commit is contained in:
parent
fcecd97224
commit
15b9acd12f
@ -37,7 +37,7 @@ matrix:
|
|||||||
# skip the global install step
|
# skip the global install step
|
||||||
install:
|
install:
|
||||||
- cargo install --debug --force rustfmt-nightly
|
- cargo install --debug --force rustfmt-nightly
|
||||||
script: cargo fmt -- --write-mode=diff
|
script: cargo fmt -- --check
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
@ -23,7 +23,8 @@ pub fn get_git_diff(filename: &str) -> Option<LineChanges> {
|
|||||||
diff_options.pathspec(pathspec);
|
diff_options.pathspec(pathspec);
|
||||||
diff_options.context_lines(0);
|
diff_options.context_lines(0);
|
||||||
|
|
||||||
let diff = repo.diff_index_to_workdir(None, Some(&mut diff_options))
|
let diff = repo
|
||||||
|
.diff_index_to_workdir(None, Some(&mut diff_options))
|
||||||
.ok()?;
|
.ok()?;
|
||||||
|
|
||||||
let mut line_changes: LineChanges = HashMap::new();
|
let mut line_changes: LineChanges = HashMap::new();
|
||||||
|
@ -29,10 +29,7 @@ impl BatTester {
|
|||||||
|
|
||||||
pub fn test_snapshot(&self, style: &str) {
|
pub fn test_snapshot(&self, style: &str) {
|
||||||
let output = Command::new(&self.exe)
|
let output = Command::new(&self.exe)
|
||||||
.args(&[
|
.args(&["tests/snapshots/sample.rs", &format!("--style={}", style)])
|
||||||
"tests/snapshots/sample.rs",
|
|
||||||
&format!("--style={}", style),
|
|
||||||
])
|
|
||||||
.output()
|
.output()
|
||||||
.expect("bat failed");
|
.expect("bat failed");
|
||||||
// have to do the replace because the filename in the header changes based on the current working directory
|
// have to do the replace because the filename in the header changes based on the current working directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user