diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..fd764b8 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,17 @@ +name: pre-commit + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5340e09 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + stages: [commit] + - id: check-json + stages: [commit] + - id: check-toml + stages: [commit] + - id: check-merge-conflict + stages: [commit] + - id: check-case-conflict + stages: [commit] + - id: detect-private-key + stages: [commit] + - repo: https://github.com/crate-ci/typos + rev: v1.16.20 + hooks: + - id: typos + stages: [commit] diff --git a/src/measurements.rs b/src/measurements.rs index 63b597b..a5a20cd 100644 --- a/src/measurements.rs +++ b/src/measurements.rs @@ -104,7 +104,7 @@ fn log_measurements_by_test_type( if !type_measurements.is_empty() { let (min, q1, median, q3, max, avg) = calc_stats(type_measurements).unwrap(); - let formated_payload = format_bytes(payload_size); + let formatted_payload = format_bytes(payload_size); let fmt_test_type = format!("{:?}", test_type); stat_measurements.push(StatMeasurement { test_type, @@ -118,7 +118,7 @@ fn log_measurements_by_test_type( }); if output_format == OutputFormat::StdOut { println!( - "{fmt_test_type:<9} {formated_payload:<7}| min {min:<7.2} max {max:<7.2} avg {avg:<7.2}" + "{fmt_test_type:<9} {formatted_payload:<7}| min {min:<7.2} max {max:<7.2} avg {avg:<7.2}" ); if verbose { let plot = boxplot::render_plot(min, q1, median, q3, max);