Skip to content

Commit

Permalink
ci: Add job to check code formatting (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh authored Jul 27, 2024
1 parent c495920 commit 2d6141e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ jobs:
with:
command: clippy
args: --all-features
rustfmt:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
test:
runs-on: ubuntu-latest
steps:
Expand Down
18 changes: 14 additions & 4 deletions bin/src/control.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{
error::Error,
fmt::{self, Display}, time::Instant,
fmt::{self, Display},
time::Instant,
};

use matching::MatchingEntry;
Expand Down Expand Up @@ -79,17 +80,26 @@ pub fn run_tool_on_merge_scenario(
let start = Instant::now();
log::info!("Started calculation of matchings between left and base");
let matchings_left_base = matching::calculate_matchings(&left_tree, &base_tree);
log::info!("Finished calculation of matchings between left and base in {:?}", start.elapsed());
log::info!(
"Finished calculation of matchings between left and base in {:?}",
start.elapsed()
);

let start = Instant::now();
log::info!("Started calculation of matchings between right and base");
let matchings_right_base = matching::calculate_matchings(&right_tree, &base_tree);
log::info!("Finished calculation of matchings between right and base in {:?}", start.elapsed());
log::info!(
"Finished calculation of matchings between right and base in {:?}",
start.elapsed()
);

let start = Instant::now();
log::info!("Started calculation of matchings between left and right");
let matchings_left_right = matching::calculate_matchings(&left_tree, &right_tree);
log::info!("Finished calculation of matchings between left and right in {:?}", start.elapsed());
log::info!(
"Finished calculation of matchings between left and right in {:?}",
start.elapsed()
);

let start = Instant::now();
log::info!("Starting merge of the trees");
Expand Down
2 changes: 1 addition & 1 deletion merge/src/merge_terminals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn merge_terminals<'a>(
right: &'a Terminal<'a>,
) -> Result<MergedCSTNode<'a>, MergeError> {
log::trace!("Calling merge terminal");

// Nodes of different kind, early return
if left.kind != right.kind {
return Err(MergeError::NodesWithDifferentKinds(
Expand Down

0 comments on commit 2d6141e

Please sign in to comment.